08.存儲Cinder→4.Cinder組件詳解→1.cinder-api

  1. cinder-api 向外界暴露若干 HTTP REST API 接口,在 keystone 中咱們能夠查詢 cinder-api 的 endponits。
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    root@controller:~# openstack endpoint list
    +----------------------------------+-----------+--------------+----------------+---------+-----------+------------------------------------------------+
    | ID                               | Region    | Service Name | Service Type   | Enabled | Interface | URL                                            |
    +----------------------------------+-----------+--------------+----------------+---------+-----------+------------------------------------------------+
    | 06b3d542f3ee43cd96e02bc607b2eb4e | RegionOne | cinderv3     | volumev3       | True    | public    | http://192.168.32.73/volume/v3/$(project_id)s  |
    | 15bad1304d7b46e989329c3fb4ba76d4 | RegionOne | keystone     | identity       | True    | admin     | http://192.168.32.73/identity                  |
    | 1a339b1a524341218d3e43254f93fd48 | RegionOne | cinderv2     | volumev2       | True    | public    | http://192.168.32.73/volume/v2/$(project_id)s  |
    | 2d3e96fbe41c4b7a842d8f3138edba07 | RegionOne | cinder       | block-storage  | True    | public    | http://192.168.32.73/volume/v3/$(project_id)s  |
    | 4ddb72eb412948d09100b9db2d007e21 | RegionOne | glance       | image          | True    | public    | http://192.168.32.73/image                     |
    | 75a7442ebbdb47239d5ae577b99abfe6 | RegionOne | cinder       | volume         | True    | public    | http://192.168.32.73/volume/v1/$(project_id)s  |
    | 78c763847bed477da135f0a2fcd6aa51 | RegionOne | nova_legacy  | compute_legacy | True    | public    | http://192.168.32.73/compute/v2/$(project_id)s |
    | ce509688367d4a309ed9869823cfdfb7 | RegionOne | neutron      | network        | True    | public    | http://192.168.32.73:9696/                     |
    | d78c9ca6605c48eea7921e1dcf58412b | RegionOne | nova         | compute        | True    | public    | http://192.168.32.73/compute/v2.1              |
    | f4583d37662640ad8a39a1107439b268 | RegionOne | keystone     | identity       | True    | public    | http://192.168.32.73/identity                  |
    | f51f3152ef434d72bfefc1fd3309ba54 | RegionOne | placement    | placement      | True    | public    | http://192.168.32.73/placement                 |
    +----------------------------------+-----------+--------------+----------------+---------+-----------+------------------------------------------------+
    root@controller:~# openstack endpoint show 75a7442ebbdb47239d5ae577b99abfe6
    +--------------+-----------------------------------------------+
    | Field        | Value                                         |
    +--------------+-----------------------------------------------+
    | enabled      | True                                          |
    | id           | 75a7442ebbdb47239d5ae577b99abfe6              |
    | interface    | public                                        |
    | region       | RegionOne                                     |
    | region_id    | RegionOne                                     |
    | service_id   | ef61d58a3d6b424fb96c031e4a3d2410              |
    | service_name | cinder                                        |
    | service_type | volume                                        |
    | url          | http://192.168.32.73/volume/v1/$(project_id)s |
    +--------------+-----------------------------------------------+
  2. 固然,做爲最終用戶的咱們不會直接發送 Rest API 請求。OpenStack CLI,Dashboard 和其餘須要跟 Cinder 交換的組件會使用這些 API。
  3. cinder-api 對接收到的 HTTP API 請求會作以下處理:
    1. 檢查客戶端傳入的參數是否合法有效
    2. 調用 cinder 其餘子服務的處理客戶端請求
    3. 將 cinder 其餘子服務返回的結果格式化並返回給客戶端
  4. cinder-api 接受哪些請求呢?簡單的說,只要是 Volume 生命週期相關的操做,cinder-api 均可以響應。大部分操做均可以在 Dashboard 上看到。
相關文章
相關標籤/搜索