0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[BIG-IP] [REST-API] VirtualServerに証明書を設定したい。

0
Last updated at Posted at 2019-05-28

はじめに

AnsibleでLBの設定をする際に、REST APIを使いまくってるのだけれど、VirtualServer自体を設定するのと証明書の設定をするのは方法が違ったため、備忘録として残しておきます。
BIG-IPのREST-APIの操作は会社で行っているので、結果の記載が無いこと、また思い出しで書いてるので誤字や脱字がある可能性ご容赦下さい。

VirtualServerの設定を確認するには

curl -sk -u "admin:admin" -H 'Content-Type application/json' -X GET https://x.x.x.x/mgmt/tm/ltm/virtual/(VS名)

VirtualServerの設定はこれで確認できるのですが、証明書の情報はこれでは確認できません。

特定のVirtualServerに設定された証明書を確認するには

curl -sk -u "admin:admin" -H 'Content-Type application/json' -X GET https://x.x.x.x/mgmt/tm/ltm/virtual/(VS名)?expandSubcollections=true

F5の公式サイトにある通り。
アドレスの末尾に「?expandSubcollections=true」を付けるようです。
より詳細なVirtualServerの設定内容を確認できます。
証明書の情報も入手できるようになりましたね。

特定のVirtualServerに設定された証明書をいじるためには

上記の方法ではまだ確認しか出来ていません。
F5のサイトの証明書のところに以下のような記載があると思われます。
"selfLink": "https://localhost/mgmt/tm/ltm/virtual/~Common~vs/profiles/~Common~http?ver=13.1.0"
そう。アドレスをhttps://x.x.x.x/mgmt/tm/ltm/virtual/(VS名)/profiles/とすれば弄れるのです。

実際のコマンドは以下の通りになってます。
curl -sk -u "admin:admin" -H 'Content-Type application/json' -X POST https://x.x.x.x/mgmt/tm/ltm/virtual/(VS名)/profiles -d "name:hogeProfile , fullPath:~Common~hogeProfile , context:all"
※ファイルの配置場所について、"/"を"~"と置き換えて表記する必要があるみたいですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?