-
-
Save OldCrowEW/a52ff28724f7fd0f5f822b9d70c47b46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getWorkspaceId() { | |
def response = httpRequest( | |
customHeaders: [ | |
[ name: "Authorization", value: "Bearer " + env.BEARER_TOKEN ], | |
[ name: "Content-Type", value: "application/vnd.api+json" ] | |
], | |
url: "https://app.terraform.io/api/v2/organizations/" + env.TF_ORGNAME + "/workspaces/" + env.TF_WORKSPACE | |
) | |
def data = new JsonSlurper().parseText(response.content) | |
return data.data.id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment