Go to main content

Oracle® ZFS Storage Appliance RESTful API ガイド、Release OS8.8.x

印刷ビューの終了

更新: 2021 年 8 月
 
 

サービス構成の変更

指定されたサービスの構成プロパティーを変更するには、ヘッダーに新しいプロパティー値を定義して、PUT リクエストを送信します。一部のサービスにはサブリソースがあることがあり、それらもサブリソースに定義された href に従って変更できます。成功した応答は HTTP ステータス 202 (Accepted) を返します。

次の例では、LDAP サービスのサーバーのリストを並べ替えて、サーバーのリストが優先順位の高い順になるように指定しています。LDAP 構成の詳細は、Oracle ZFS Storage Appliance 管理ガイド、Release OS8.8.x の LDAP 構成を参照してください。

現在の状態:

GET /api/service/v1/services/ldap HTTP/1.1
Host: zfs-storage.example.com:215
Accept: application/json

HTTP/1.1 200 OK
Content-Type: application/json

{
   "service":{
      "href":"/api/service/v1/services/ldap",
      "<status>":"online",
      "servers":[
         "ldap-server2.us.example.com:484",
         "ldap-server1.us.example.com:636"
      ],
      "use_server_order":false,
      "proxy_dn":"",
      "proxy_password":false,
      "base_dn":"dc=us,dc=oracle,dc=com",
      "search_scope":"one",
      "cred_level":"proxy",
      "auth_method":"simple",
      "use_tls":false,
      "user_search":[
      ],
      "user_mapattr":[
      ],
      "user_mapobjclass":[
      ],
      "group_search":[
      ],
      "group_mapattr":[
      ],
      "group_mapobjclass":[
      ],
      "netgroup_search":[
      ],
      "netgroup_mapattr":[
      ],
      "netgroup_mapobjclass":[
      ],
      "server-000":{
         "host":"ldap-server2.us.example.com",
         "port":484,
         "status": "online",
         "last_seen": "142s",
         "rtt": "70.285ms",
         "err_msg": "",
         "href":"/api/service/v1/services/ldap/server-000"
      },
      "server-001":{
         "host":"ldap-server1.us.example.com",
         "port":636,
         "status": "online",
         "last_seen": "142s",
         "rtt": "126.013ms",
         "err_msg": "",
         "href":"/api/service/v1/services/ldap/server-001"
      }
   }
}

リクエストの例:

PUT api/service/v1/services/ldap HTTP/1.1
Host: zfs-storage.example.com:215
Content-Type: application/json

{
   "servers": ["ldap-server1.us.example.com:636,ldap-server2.us.example.com:484"],
   "use_server_order":true
}

結果例:

HTTP/1.1 202 Accepted
Content-Length: 1295
Content-Type: application/json; charset=utf-8
X-Zfssa-Service-Api: 1.0

{
   "service":{
      "href":"/api/service/v1/services/ldap",
      "<status>":"online",
      "servers":[
         "ldap-server1.us.example.com:636",
         "ldap-server2.us.example.com:484"
      ],
      "use_server_order":true,
      "proxy_dn":"",
      "proxy_password":false,
      "base_dn":"dc=us,dc=oracle,dc=com",
      "search_scope":"one",
      "cred_level":"proxy",
      "auth_method":"simple",
      "use_tls":false,
      "user_search":[
      ],
      "user_mapattr":[
      ],
      "user_mapobjclass":[
      ],
      "group_search":[
      ],
      "group_mapattr":[
      ],
      "group_mapobjclass":[
      ],
      "netgroup_search":[
      ],
      "netgroup_mapattr":[
      ],
      "netgroup_mapobjclass":[
      ],
      "server-000":{
         "host":"ldap-server1.us.example.com",
         "port":636,
         "status": "online",
         "last_seen": "142s",
         "rtt": "126.013ms",
         "err_msg": "",
         "href":"/api/service/v1/services/ldap/server-000"         
      },
      "server-001":{
         "host":"ldap-server2.us.example.com",
         "port":484,
         "status": "online",
         "last_seen": "142s",
         "rtt": "70.285ms",
         "err_msg": "",
         "href":"/api/service/v1/services/ldap/server-001"
      }
   }
}