Using the Project Service API, you can create a project. You can also modify or delete a project and list all projects in an organization.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Project service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that the project roles that you plan to assign have sufficient permissions to perform project-related tasks.
Note: A user with the project administrator or project member role can perform a limited number of project-related tasks. For a complete list of tasks and roles required, see Organization and service user roles in VMware Aria Automation.
- Prepare parameters including the project name, description, and email addresses for administrators, members, or viewers.
Procedure
Example: Create a Project
Create a project named Example-project with administrators, members, and viewers at mycompany.com. This example assumes that Example-project does not exist.
Note: If your organization uses an API service that is hosted outside of the United States, your URL variable must include a country abbreviation. See
Regional Endpoints for VMware Aria Automation APIs.
$ url='https://api.mgmt.cloud.vmware.com'
$ api_version='2019-01-15'
$ project_name='Example-project'
Create a project with an administrator, member, and viewer assigned to user type roles.
$ curl -X POST \ "$url/project-service/api/projects?apiVersion=$api_version" \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "name" : "'$project_name'", "description" : "This is an example project", "administrators" : [{"email" : "[email protected]", "type" : "user"}], "members" : [{"email" : "[email protected]", "type" : "user"}], "viewers" : [{"email" : "[email protected]", "type" : "user"}] }' | jq "."
The response shows the administrators, members, and viewers related to the project and the project ID.
{ "id": "094a2fab-7715-4844-94f9-71b45452da27", "name": "Example-project", "description": "This is an example project", "orgId": "f670fdfc-66d6-4689-9793-d524e7066d1e", "administrators": [ { "email": "[email protected]", "type": "user" } "members": [ { "email": "[email protected]", "type": "user" }, ], "viewers": [ { "email": "[email protected]", "type": "user" } ] "supervisors": [], "constraints": { "network": { "conditions": [] } }, "properties": {}, "cost": { "cost": 0, "costSyncTime": "2019-05-13T12:47:10.624Z", "costUnit": "USD" }, "operationTimeout": 0, "sharedResources": true }, ...