Atšķirības starp "Hostnet OpenStack Cloud Compute API" versijām

No ''Hostnet Wiki''
Pārlēkt uz: navigācija, meklēt
(Jauna lapa: Once you have these pieces of information, you can pass them into the SDK by replacing {username}, {password}, {domain} and {projectID} with your info: # {username}, {apiKey} below a...)
 
35. rindiņa: 35. rindiņa:
  
 
   export OS_TOKEN="{X-Subject-Token}"
 
   export OS_TOKEN="{X-Subject-Token}"
 +
 +
# Get service endpoints:
 +
 +
<syntaxhighlight lang=bash>
 +
curl -s -X GET https://identity.api.cloud.hostnet.lv/v3/endpoints \                       
 +
-H "X-Auth-Token: $OS_TOKEN" | python -m json.tool
 +
</syntaxhighlight>
 +
 +
# Set env variable for public compute URL:
 +
 +
  export ENDPOINT="{computeURL}"
 +
 +
# List available flavors:
 +
 +
<syntaxhighlight lang=bash>
 +
curl -s -X GET $ENDPOINT/flavors \
 +
-H "X-Auth-Token: $OS_TOKEN" | python -m json.tool
 +
</syntaxhighlight>
 +
 +
!!!Full list of flavors!!!

Versija, kas saglabāta 2017. gada 5. jūnijs, plkst. 10.25

Once you have these pieces of information, you can pass them into the SDK by replacing {username}, {password}, {domain} and {projectID} with your info:

  1. {username}, {apiKey} below are placeholders, do not enclose '{}' when you replace them with actual credentials.
~ curl -i \
  -H "Content-Type: application/json" \
  -d '
{ "auth": {
    "identity": {
      "methods": [
        "password"
      ],
      "password": {
        "user": {
          "name": "{username}",
          "domain": {
            "id": "{domain}"
          },
          "password": "{password}"
        }
      }
    },
    "scope": {
      "project": {
        "id": "{projectID}"
      }
    }
  }
}' \
  https://identity.api.cloud.hostnet.lv/v3/auth/tokens
  1. From the resulting, set environment variable as X-Subject-Token value:
 export OS_TOKEN="{X-Subject-Token}"
  1. Get service endpoints:
curl -s -X GET https://identity.api.cloud.hostnet.lv/v3/endpoints \                        
-H "X-Auth-Token: $OS_TOKEN" | python -m json.tool
  1. Set env variable for public compute URL:
 export ENDPOINT="{computeURL}"
  1. List available flavors:
curl -s -X GET $ENDPOINT/flavors \
-H "X-Auth-Token: $OS_TOKEN" | python -m json.tool

!!!Full list of flavors!!!