Created
May 19, 2020 14:40
-
-
Save kevincloud/2aa87c781bbbb4554838c617332e6f4f 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