OpenStack API Debug openstackeveryproject_cli,curl_based

Source: Internet
Author: User

1, based on OpenStack per service component client clients, the Eg,nova client package name is Python-novaclient,

All the same, replace the python-Novaclient (Nova with the component name)

Before using the component client Invoke API you have to configure the admin to manage RC files or directly input--os-auth-username= personal feel configuration rc file when calling, I don't know what you think.

Admin (superUser admin rc file)

EXAMPLE,RC Os_auth_url Configure the modifications to your environment.

Example Demo Tenant

Call

.... Each of the OpenStack components-based CLI calls to debug the OpenStack API itself according to man, Oh, ruiy think that people are more expensive than diligent ;

< Two, call OpenStack components api> based on curl

1, based on the tenant user authentication get API (in fact, here Ruiy again, we actually in the process of invoking the API to enter each user's token and tenantauthenticate (TENANTNAME/PASSWD))

About the relationship between tenant usercredential and project

Ruiy think similar to SVN under the project and the rights of the user-like concept;

1, based on the Curl call API get TOEKN

Curl-i ' Http://5.10.124.181:5000/v2.0/tokens '-x post-h "Content-type:application/json"-H "Accept:application/json" -d ' {"auth": {"Tenantname": "Demo", "Passwordcredentials": {"username": "demo", "Password": "321"}} '

2,not know Tenantname or id,you can send an authentication request
With an empty tenant (get tenant ID based on passwordcredential)

Curl-i ' Http://5.10.124.181:5000/v2.0/tokens '-x post-h "Content-type:application/json"-H "Accept:application/json" -d ' {"auth": {"Tenantname": "", "Passwordcredentials": {"username": "demo", "Password": "321"}} '

3,use the Identity API to request a list of tenants

Curl-i Http://5.10.124.181:5000/v2.0/tenants-X get-h "user-agent:python-keystoneclient"-H "X-auth-token: 3be3f0b35ecf498596d79cdac92f8482 "

4,use the Identity API to request a list of endpoints

Curl-i-X GET http://5.10.124.181:35357/v2.0/endpoints-h "user-agent:python-keystoneclient"-H " x-auth-token:09e5cd53f9464b549ef40270ce050141 "

Ruiy here to say something about the 3 admin URLs for each OpenStack Endpointservicecatalog

Adminurl,internalurl,publicurl;

5,use the Compute API to list servers

Curl-v-H "x-auth-token:3da1d59d15354f299593f96ab0c1e135" http://5.10.124.181:8774/v2/ F963230ce6d54dc2a4a7b42b3f9989b4/servers

Based on the OpenStack component CLI Debug API

Component client program installation (using the PIP (Python Index package) tool)

PIP install [--upgrade] python- PROJECT Client (update update repo,git repo) (upgrade, upgrading the version of the package based on the git repo installation)
Note that the complete command to upgrade a package is pip install--upgrade python-projectclient Of course we are here to demonstrate the installation and upgrade of the OpenStack Project component client program
Uninstall the words
Pip Uninstall Python-novaclient

Example, demo CLI-based command launch an VM (VSI) instance
To launch instances, you must choose a name, an image, and a flavor for your instance (here instantiate a VSI virtual server instance slightly It's a little different from one, but it's just a command-line, web-based, expanded virtual machine instance.
, you can run a full image directly.
1, get the mirror

2, Get flavor

Nova Boot--image 2a20a472-b5dc-4565-b1a3-28978091d010--flavor 3 my_instance

Show detailed information about the virtual machine we just created

View RC environment variable

OpenStack API Debug openstackeveryproject_cli,curl_based

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.