Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -x
- vRA='cld-mg-vra.hci.spoc'
- token=$(curl --insecure -s -H "Accept: application/json" -H 'Content-Type: application/json' \
- --data '{"username":"configurationadmin-a@vsphere.local","password":"D3ll2020!","tenant":"tenant-a"}' \
- https://$vRA/identity/api/tokens | jq -r .id)
- request_template_url=$(curl -s --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" \
- https://$vRA/catalog-service/api/consumer/entitledCatalogItemViews \
- | jq -r '.content|.[]|select(.name|test("Centos7Dev"))|.links|.[]|select(.rel|test("GET"))|.href')
- curl -s --insecure -H "Accept: application/json" -H "Content-Type: application/json" \
- -H "Authorization: Bearer $token" $request_template_url > request_template.json
- request_url=$(curl -s --insecure -H "Content-Type: application/json" -H "Authorization: Bearer $token" \
- https://$vRA/catalog-service/api/consumer/entitledCatalogItemViews \
- | jq -r '.content|.[]|select(.name|test("Centos7Dev"))|.links|.[]|select(.rel|test("POST"))|.href')
- curl -v -s --insecure -H "Accept: application/json" -H "Content-Type: application/json" \
- -H "Authorization: Bearer $token" --data @request_template.json $request_url
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement