Accessing TMC via API and CLI
+++ author = "Shubham Sharma" title = "Accessing TMC via API and CLI" menuTitle = "How to access TMC using API and tmc cli" date = "2022-08-17" description = "How to access TMC using API and tmc cli" series = ["TMC"] codeMaxLines = 15 +++
Accessing TMC via API¶
Get CSP token¶
- Log in to the VMware Cloud Services, select your user profile in the top-right corner, and click My Account.
- In the My Account page, click API Tokens, and then click Generate Token.
- Select the required organization roles and the service roles. Depending on your requirement, you can specifically select either the organization roles or the service roles.
- Click Generate.
- Copy or save the generated token.
Get Access token¶
Use the Access token to call the TMC API
Helpful API commands¶
List all management clusters¶
Get Management cluster status¶
Get Management cluster health Details¶
Accessing TMC via CLI¶
Install the Tanzu Mission Control CLI (tmc)
- In the left navigation pane of the Tanzu Mission Control console, click Automation center.
- On the Automation Center page, click Download CLI, and then choose the environment where you want to use the CLI.
Get the CSP token¶
You can export the CSP token using the steps described in the previous section