Skip to content

Instantly share code, notes, and snippets.

@laidbackware
Last active November 25, 2020 10:15
Show Gist options
  • Save laidbackware/309b86026dab897eadce688f0f3b2aaa to your computer and use it in GitHub Desktop.
Save laidbackware/309b86026dab897eadce688f0f3b2aaa to your computer and use it in GitHub Desktop.
Upload NSX-T principal with Cert
cert_request=$(cat <<END
{
"name": "tkgi-nsx-t-superuser",
"node_id": "node-1",
"role": "enterprise_admin",
"is_protected": "true",
"certificate_pem" : "$(awk '{printf "%s\\n", $0}' tkgi-nsx-t-superuser.crt)"
}
END
)
curl -k -X POST \
"https://DCLMXNSXT.dm.ae/api/v1/trust-management/principal-identities/with-certificate" \
-u "admin:$NSX_PASSWORD" \
-H 'content-type: application/json' \
-d "$cert_request"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment