How to configure up API access for mCloud

This guide contains an overview of how you can use the OpenStack CLI client with the API services in your mCloud Dashboard.

Method

Installing and configuring the OpenStack CLI Client

  1. Using the link below, Install the OpenStack CLI client on your preferred workstation

    1. https://docs.openstack.org/newton/user-guide/common/cli-install-openstack-command-line-clients.html

  2. Log into your mCloud Dashboard (https://mcloud.micron21.com)

  3. At the top right, click your user, then click "OpenStack RC file" and save/copy the contents of the file to your workstation.

  4. When you want to use the client, load the RC file by running "source admin-openrc.sh" or "source project-name-openrc.sh" as required and enter your user's password when you are prompted for credentials

  5. You can now use the OpenStack CLI client via the API

    1. Note: Each time you create a new session (terminal, ssh, etc) you will need to re-run the source command to load the environment variables.

Issuing a custom keystone token

Sometimes when making changes via CLI or Postman/curl and testing, you will need an authentication token.

Once you have set up your OpenStack client, you can issue a token, example below:

# openstack token issue
+------------+-------------------------------------+
| Field      | Value                               |
+------------+-------------------------------------+
| expires    | 2024-11-14T10:02:55+0000            |
| id         | { HERE WILL BE YOUR TOKEN}          |
| project_id | cb58ecXXXXXXXXXXXXXXXXXXXXX38e06    |
| user_id    | 5c9495XXXXXXXXXXXXXXXXXXXXXfcd50    |
+------------+-------------------------------------+

You can also curl directly against Keystone, with a few more arguments. More information from the official documentation: https://docs.openstack.org/keystone/latest/api_curl_examples.html

Once added, you can use that token when issuing Curl commands.

Using a custom keystone token against an API endpoint

Here's an example of using a token against the Octavia Load Balancer Service API endpoint.

curl -g -i -X GET https://mcloud.micron21.com:9876/v2.0/lbaas/loadbalancers -H "Accept: application/json" -H "User-Agent: openstacksdk/3.0.0 keystoneauth1/5.6.0 python-requests/2.31.0 CPython/3.12.3" -H "X-Auth-Token: { HERE PUT YOUR TOKEN }"

e.g.

curl -g -i -X GET https://mcloud.micron21.com:9876/v2.0/lbaas/loadbalancers -H "Accept: application/json" -H "User-Agent: openstacksdk/3.0.0 keystoneauth1/5.6.0 python-requests/2.31.0 CPython/3.12.3" -H "X-Auth-Token: gAAAXXXXXXXXXXXXXXXXXXXXXXXatbjOj8ZRoWhsK-g416Ky7zXJfiPQqDdYje6y-Y2nPQBefh3Rfezlk3zc0-CFwFZfUHvfuWXXXXXXXXXXXXXXXXXXXXXXuvCpqHhmtvXWpnr-x0ygulB_sWXXXXXXXXXXXXXXXoS-Q6yfZSTncXMYjxraTN0"

returns:

HTTP/2 200
date: Wed, 13 Nov 2024 23:20:56 GMT
server: Apache/2.4.52 (Ubuntu)
x-openstack-request-id: req-7998fd45-e91e-4b6e-8c4c-8759152821cd
content-type: application/json
content-length: 48

{"loadbalancers": [], "loadbalancers_links": []}

Keystone and API flowchart image example

API flowchart.png


Can't find what you're looking for?

Create or manage support tickets directly with Micron21

You will need to register a new account if this is the first time lodging a ticket.

If you have previous lodged a ticket either online, email or over the phone you will already have an account. Please reset your password, if you have not logged into the support portal before.

Lodge a ticket Manage existing tickets

Need to send us information securely? Use our Escrow service here

Need more advanced support?

Micron21 provides a comprehensive approach to customer care that starts with a base 24/7 support that is included free with every service we offer - there are no charges to enjoy a basic level of support with Micron21 and you are not restricted in how you contact us to receive assistance any time of day or night.

For those who require more advanced support though, our Customer Care plans and Ad-Hoc support are designed to completely remove the complexity of IT management - from taking full responsibility for your entire infrastructure or tailoring a custom approach, we have the capability and know-how.

 

If you've organised remote assistance from Micron21, click here to connect

Sign up for the Micron21 Newsletter