Skip to end of banner
Go to start of banner

Examples

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 192 Next »

Action usage examples

Examples give users ideas on actual usage. We use automation to generate, test, and run these actions, so names and combinations may be odd or repetitive (wink). In many cases, other actions or environmental setup is required for the action to run, so you will need to adjust the action parameters and setup appropriate for your environment. 

Command line environments can be different, especially between Windows and non-Windows systems. Our Tips page talks about command line escaping differences and there are differences with respect to environment variable references ($ for non-Windows and %...% for Windows). These differences can impact examples, so recognize and adjust for your platform. In particular, all examples here are run with the standard bash shell on Linux.



addAccessToken

--action addAccessToken --name "ztokens" --permission "PROJECT_ADMIN, REPO_ADMIN"
--action addAccessToken --userId "admin" --name "ztokens" --permission "PROJECT_READ, REPO_READ" --user "admin" --password "***"

getAccessTokenList

--action getAccessTokenList
--action getAccessTokenList --regex "ztokens"
--action getAccessTokenList --userId "admin"

getClientInfo

--action getClientInfo

getFileInfo

--action getFileInfo --project "Experiment" --repository "acli" --path "license"
--action getFileInfo --project "Experiment" --repository "acli" --path "license/LICENSE.txt"

getFileList

--action getFileList --project "Experiment" --repository "acli" --outputType "text" --columns "-1,2,3" --descendents --options "tableNoWrap"
--action getFileList --project "Experiment" --repository "acli" --outputType "text" --options "tableNoWrap"
--action getFileList --project "Experiment" --repository "acli" --path "license" --outputType "text" --options "tableNoWrap"
--action getFileList --project "Experiment" --repository "acli" --regex "src/main/java/.*" --descendents --outputType "text" --options "tableNoWrap"

getProjectList

--action getProjectList --token "***"

getServerInfo

--action getServerInfo --outputFormat 2 --dateFormat "yyyy-MM-dd HH:mm"
--action getServerInfo --outputFormat 999
--action getServerInfo --user "anonymous"

getSource

--action getSource --project "Experiment" --repository "acli" --path "license/LICENSE.txt"

removeAccessToken

--action removeAccessToken --userId "admin" --name "461458838603"

run

--action run -i "-a getFileInfo --project EXPERIMENT --repository acli --path src/itest/bitbucket/resources/run.txt" -i "-a run -f @bitbucket220:@downloadUrl@"
--action run -i "-a getServerInfo --outputFormat 2 --outputType text" -i "-a getReplacementVariableList --outputType text"
--action run -i "-a getSource --project EXPERIMENT --repository acli --path src/itest/bitbucket/resources/run.txt --file @temp" -i "-a getReplacementVariableList" -i "-a run -f @temp"
--action run -i "-a run -f @bitbucket220:projects/EXPERIMENT/repos/acli/raw/src/itest/bitbucket/resources/run.txt?at=refs%2Fheads%2Fmaster"
--action run --file "./src/itest/bitbucket/resources/run.txt"
--action run --file "./src/itest/bitbucket/resources/runWithFindReplace.txt" --findReplace "##action##:getServerInfo"
--action run --input "upm -a getAppList --token MjE1MTU2MTEzNzExOiC1JmZTS9cOy+aR9/xqxMCxDxl2"
--action run --token "***" --input "upm -a getAppList"

runFromList

--action runFromList --list "Client, Server" --common "-a get@entry@Info"

runFromProjectList

--action runFromProjectList --common "-a getProject --project \"@project@\"" --regex "EXPERIMENT" --continue
--action runFromProjectList --common "-a getProject --project \"@projectId@\"" --continue --regex "EXPERIMENT"
--action runFromProjectList --common "-a renderRequest --url rest/default-reviewers/latest/projects/@project@/conditions --contentType JSON --options pretty,setReplacementVariables"

runFromRepositoryList

--action runFromRepositoryList --project "@all" --common "-a getRepository --project @projectId@ --repository @repositoryId@"
--action runFromRepositoryList --project "@all" --common "-a getRepository --project @projectId@ --repository @repositoryId@" --limit 1
--action runFromRepositoryList --project "EXPERIMENT" --common "-a getRepository --project @project@ --repository \"@repository@\"" --continue
--action runFromRepositoryList --project "EXPERIMENT" --common "-a getRepository --project @projectId@ --repository \"@repositoryId@\"" --continue --regex "ex1"

validateLicense

--action validateLicense
  • No labels