• openstack查看命令的restful调用形式


    [root@cc10 fast-pulsar2]# 
    [root@cc10 fast-pulsar2]# cinder --debug type-create hzb
    DEBUG:keystoneclient.session:REQ: curl -g -i -X GET http://172.16.0.10:35357/v3 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
    DEBUG:keystoneclient.session:RESP: [200] Date: Mon, 13 Aug 2018 08:53:55 GMT Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 Vary: X-Auth-Token x-openstack-request-id: req-72e91772-cfd5-48b3-af64-10fe73db0110 Content-Length: 251 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/json 
    RESP BODY: {"version": {"status": "stable", "updated": "2016-04-04T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.6", "links": [{"href": "http://172.16.0.10:35357/v3/", "rel": "self"}]}}
    
    DEBUG:keystoneclient.auth.identity.v3.base:Making authentication request to http://172.16.0.10:35357/v3/auth/tokens
    DEBUG:keystoneclient.session:REQ: curl -g -i -X POST http://172.16.0.10:8776/v2/852869c53f2d4a4387d2c90a2167d762/types -H "User-Agent: python-cinderclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}89bfee5ba160199a800d6014a9911c9d4d265fea" -d '{"volume_type": {"os-volume-type-access:is_public": true, "name": "hzb", "description": null}}'
    DEBUG:keystoneclient.session:RESP: [200] X-Compute-Request-Id: req-432334a3-ee1c-41ae-a737-c9f3374026db Content-Type: application/json Content-Length: 178 X-Openstack-Request-Id: req-432334a3-ee1c-41ae-a737-c9f3374026db Date: Mon, 13 Aug 2018 08:53:56 GMT Connection: keep-alive 
    RESP BODY: {"volume_type": {"name": "hzb", "extra_specs": {}, "os-volume-type-access:is_public": true, "is_public": true, "id": "dada2d77-2ffb-424e-a5fb-d3f81469b141", "description": null}}
    
    +--------------------------------------+------+-------------+-----------+
    |                  ID                  | Name | Description | Is_Public |
    +--------------------------------------+------+-------------+-----------+
    | dada2d77-2ffb-424e-a5fb-d3f81469b141 | hzb  |      -      |    True   |
    +--------------------------------------+------+-------------+-----------+

    也就是执行命令的时候增加 --debug

  • 相关阅读:
    可能有点用的东西
    专题整理
    模拟赛x+1
    【原】如何利用 events 提升 k8s 集群可观察性
    【原】k8s ingress-nginx 针对指定 User-Agent 爬虫进行限速
    装饰者模式-动态的包装原有对象的行为
    观察者模式-将消息通知给观察者
    策略模式-定义一个算法族
    工厂模式-将对象的创建封装起来
    单例模式的五种实现方式及优缺点
  • 原文地址:https://www.cnblogs.com/boshen-hzb/p/9469762.html
Copyright © 2020-2023  润新知