- What's New
- Function Overview
- Product Bulletin
- Service Overview
-
Billing
- Billing Overview
- Billing Modes
- Billed Items
- Billing Examples
- Billing Mode Changes
- Renewing Subscriptions
- Bills
- Arrears
- Billing Termination
- Cost Management
-
Billing FAQ
- How Is CBR Billed?
- What Is the Billing Cycle of Pay-per-Use Vaults?
- How Do I Disable CBR?
- How Do I Unsubscribe from CSBS or VBS Resource Packages?
- Why Is a Message Displayed Indicating Insufficient User Rights When I Create a Policy?
- What Can I do If a Yearly/Monthly-Billed Vault Is About to Expire?
- How Do I Unsubscribe from a Vault?
- What Should I Do If the Fee Is Too High When I Expand the Capacity of a Vault?
- Can I Change a Server Backup Vault to a Disk Backup Vault or the Other Way Around?
- Why Are CBR Backups Displayed on the VBS Console?
- What Charges Will I Incur When Using a Backup to Create an Image?
- How Do I Purchase a CBR Replication Traffic Package?
- Can I Change the Protection Type of an Existing Vault?
- What Resources Do I Need to Implement Cross-Region Backup Replication?
- Why AM I Still Being Billed After a Resource is Deleted?
- Getting Started
-
User Guide
- Management permissions
-
Vault Management
- Overview
- Viewing a Vault
- Deleting a Vault
- Associating Resources to a Vault
- Dissociating Resources from a Vault
- Migrating Resources from a Vault
- Expanding Vault Capacity
- Reducing Vault Capacity
- Changing from Pay-per-Use to Yearly/Monthly
- Changing Vault Specifications
- Replicating a Vault Across Regions
- Managing Vault Tags
- Managing the Enterprise Projects of Vaults
- Enabling Backup Locking
- Backup Management
- Policy Management
- Organizational Policy Management
- Application-Consistent Backup
- File Backup (Supported Conditionally)
-
Restoring Data
- Restoring from a Cloud Server Backup
- Creating an Image from a Cloud Server Backup
- Restoring from a Cloud Disk Backup
- Creating a Disk from a Cloud Disk Backup
- Creating a File System from an SFS Turbo Backup
- Restoring from a Desktop Backup
- Restoring from a File Backup
- Restoring from a Hybrid Cloud Backup
- (Optional) Migrating Resources from CSBS/VBS
- Managing Tasks
- Cloud Eye Monitoring
- Recording CBR Operations Using CTS
- Quotas
- Appendix
-
Hybrid Cloud Backup Feature Guide
- Hybrid Cloud Backup
- Application Scenarios
- Constraints and Limitations
-
VMware Backup
- VMware Backup Process
- Downloading and Installing eBackup
- Configuring eBackup
- Adding a VMware Protected Environment
- Preparing for VMware Backup Storage
- Performing VMware Backup
- Restoring Data Using VMware Backups
- Managing a Protected VMware Environment
- Managing VMware Backup Storage
- Managing VMware Backups
- Common Operations
-
Best Practices
-
Using a Custom Script to Implement Application-Consistent Backup
- Using a Custom Script to Implement Consistent Backup for MySQL
- Using a Custom Script to Implement Consistent Backup for SAP HANA
- Using a Custom Script to Implement Consistent Backup for Other Linux Applications
- Verifying the Application-Consistent Backup Result
- Protecting SQL Server
- Troubleshooting a Custom Script Error
- Performing Periodic Recovery Drills Using the Backup Data
- Creating Backup Policies Based on Service Tiering
-
Using a Custom Script to Implement Application-Consistent Backup
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
CBR APIs
- Tasks
- Protection
- Backups
- Backup Sharing
-
Vaults
- Creating a Vault
- Querying a Specified Vault
- Querying the Vault List
- Modifying a Vault
- Deleting a Vault
- Dissociating Resources
- Associating Resources
- Applying a Policy to a Vault
- Removing a Policy from a Vault
- Querying the Vault List in Other Regions
- Migrating Resources
- Batch Modifying Vaults
- Setting Auto Backup for a Vault
- Creating a Yearly/Monthly Vault
- Querying Vault Usage of a Project
- File Backup
- Tags
- Policies
- Organizational Policies
- Metering
- Operations
- Restore Points
- Projects
- Application Cases
- Permissions Policies and Supported Actions
- Appendix
- SDK Reference
-
Troubleshooting
- Failed to Execute a Backup Task
- Failed to Delete a Backup
- Failed to Expand the Vault Capacity
- Failed to Attach Disks
- Data Disks Are Not Displayed After a Windows Server Is Restored
- Failed to Cancel Backup Sharing
- Failed to Download or Install the Agent Required by Application-Consistent
- Failed to Install the Agent on Windows
- Failed to Implement Application-Consistent Backup
- A Server Created Using an Image Enters Maintenance Mode After Login
- Failed to Migrate VMware Backups to the Cloud
- Failed to Restore a VMware Backup to a Cloud Server
- An Error Message Is Displayed Indicating that the Path of a Storage Unit Is Invalid
- Failed to Import an eBackup Image Template, with an Error Displayed Indicating That the File Is Invalid
- The Download Dialog Box Disappears When I Download eBackup on a VMware VM
- File Backup Failed Due to Inconsistent Time Between Backup Client and UTC Time
-
FAQs
- Concepts
-
Billing
- How Is CBR Billed?
- What Is the Billing Cycle of Pay-per-Use Vaults?
- How Do I Disable CBR?
- How Do I Unsubscribe from CSBS or VBS Resource Packages?
- Why Is a Message Displayed Indicating Insufficient User Rights When I Create a Policy?
- What Can I do If a Yearly/Monthly-Billed Vault Is About to Expire?
- How Do I Unsubscribe from a Vault?
- What Should I Do If the Fee Is Too High When I Expand the Capacity of a Vault?
- Can I Change a Server Backup Vault to a Disk Backup Vault or the Other Way Around?
- Why Are CBR Backups Displayed on the VBS Console?
- What Charges Will I Incur When Using a Backup to Create an Image?
- How Do I Purchase a CBR Replication Traffic Package?
- What Resources Do I Need to Implement Cross-Region Backup Replication?
-
Backup
- Do I Need to Stop the Server Before Performing a Backup?
- Can I Back Up a Server Deployed with Databases?
- How Can I Distinguish Automatic Backups From Manual Backups?
- Can I Choose to Back Up Only Some Partitions of a Disk?
- Does CBR Support Cross-Region Backup?
- How Do I Migrate Server Data Across Regions Using Server Backups?
- Can I Back Up Two Disks to One Target Disk?
- How Do I Replicate a Disk to the Same AZ in a Region as the Source Disk?
- Can I Migrate Backups Between Vaults?
- Can I Use Its Backup for Restoration After a Resource Is Deleted?
- How Many Backups Can I Create for a Resource?
- Can I Use an Incremental Backup to Restore Data After a Full Backup Is Deleted?
- Can I Stop an Ongoing Backup Task?
- How Do I Reduce the Vault Space Occupied by Backups?
- How Do I View the Size of Each Backup?
- How Do I View My Backup Data?
- How Long Will My Backups Be Kept?
- How Do I Implement Periodic Full Backups for My Resources?
- How Do I Query Resources that Have not Been Backed Up?
- Is There Any Requirement on the Network Bandwidth During Data Backup?
-
Capacity
- How Large of a Vault Do I Need?
- Why Is My Backup Size Larger Than My Disk Size?
- What Can I Do If the Vault Capacity Is Not Enough?
- Why Does the Used Capacity of a Vault Change Only Slightly After I Deleted Unwanted Backups?
- Will Backup Continue If the Usage of a Vault Reaches the Upper Limit?
- How Do I Adjust the Vault Capacity Alarm Threshold?
-
Restoration
- Do I Need to Stop the Server Before Restoring Data Using Backups?
- Can I Use a System Disk Backup to Recover an ECS?
- Do I Need to Stop the Server Before Restoring Data Using Disk Backups?
- Can a Server Be Restored Using Its Backups After It Is Changed?
- Can a Disk Be Restored Using Its Backups After Its Capacity Is Expanded?
- What Can I Do if the Password Becomes a Random One After I Use a Backup to Restore a Server or Use an Image to Create a Server?
- What Changes Will Be Made to the Original Backup When I Use the Backup to Restore a Server?
- How Do I Restore Data to a New Server?
- How Do I Restore a Data Disk Backup to a System Disk?
- Can I Use CBR to Restore Data to Any Point When the Data Was Backed Up?
- Can I Stop an Ongoing Restoration Task?
-
Policies
- How Do I Configure Automatic Backup for a Server or Disk?
- Why the New Retention Rule I Changed Is Not Applied?
- How Do I Back Up Multiple Resources at a Time?
- How Do I Retain My Backups Permanently?
- How Can I Cancel Auto Backup or Auto Replication?
- How Can I Have the System Automatically Delete Backups That I No Longer Need?
- Why Aren't My Backups Deleted Based on the Retention Rule?
- Optimization
-
Others
- Is There a Quota for CBR Vaults?
- Can I Merge My Vaults?
- How Do I Delete a Backup That Has Been Used to Create an Image While Retaining the Image?
- Can I Export Disk Backup Data to Another Server?
- Why Do I Need a Vault to Accept the Image Shared to Me?
- Can I Download Backup Data to a Local PC?
- How Do I Copy Disk Data to Another Account?
- Videos
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Service Overview
- Getting Started
- Vault Management
- Backup Management
- Policy Management
- Restoring Data
- Managing Tasks
- Monitoring
- Quotas
-
FAQs
- Concepts
- Billing
-
Backup
- Do I Need to Stop the Server Before Performing a Backup?
- Can I Back Up a Server Deployed with Databases?
- How Can I Distinguish Automatic Backups From Manual Backups?
- Can I Choose to Back Up Only Some Partitions of a Disk?
- Does CBR Support Cross-Region Backup?
- Can I Back Up Two Disks to One Target Disk?
- How Do I Replicate a Disk to the Same AZ in a Region as the Source Disk?
- Will the Server Performance Be Affected If I Delete Its Backups?
- Can I Use Its Backup for Restoration After a Resource Is Deleted?
- How Many Backups Can I Create for a Resource?
- Can I Use an Incremental Backup to Restore Data After a Full Backup Is Deleted?
- Can I Stop an Ongoing Backup Task?
- How Do I Reduce the Vault Space Occupied by Backups?
- How Do I View the Size of Each Backup?
- How Do I View My Backup Data?
- How Long Will My Backups Be Kept?
- Capacity
-
Restoration
- Do I Need to Stop the Server Before Restoring Data Using Backups?
- Can I Use a System Disk Backup to Recover an ECS?
- Do I Need to Stop the Server Before Restoring Data Using Disk Backups?
- Can a Server Be Restored Using Its Backups After It Is Changed?
- Can a Disk Be Restored Using Its Backups After Its Capacity Is Expanded?
- What Can I Do if the Password Becomes a Random One After I Use a Backup to Restore a Server or Use an Image to Create a Server?
- What Changes Will Be Made to the Original Backup When I Use the Backup to Restore a Server?
- How Do I Restore Data to a New Server?
- Can I Stop an Ongoing Restoration Task?
-
Policies
- How Do I Configure Automatic Backup for a Server or Disk?
- Why the New Retention Rule I Changed Is Not Applied?
- How Do I Back Up Multiple Resources at a Time?
- How Do I Retain My Backups Permanently?
- How Can I Cancel Auto Backup?
- How Can I Have the System Automatically Delete Backups That I No Longer Need?
- Why Aren't My Backups Deleted Based on the Retention Rule?
- Optimization
-
Others
- Is There a Quota for CBR Vaults?
- Can I Merge My Vaults?
- How Do I Delete a Backup That Has Been Used to Create an Image While Retaining the Image?
- Can I Export Disk Backup Data to Another Server?
- Why Do I Need a Vault to Accept the Image Shared to Me?
- Can I Download Backup Data to a Local PC?
- How Do I Copy Disk Data to Another Account?
- Troubleshooting Cases
- Appendix
- API Reference (ME-Abu Dhabi Region)
-
Best Practices (ME-Abu Dhabi Region)
-
Using a Custom Script to Implement Application-Consistent Backup
- Using a Custom Script to Implement Consistent Backup for MySQL
- Using a Custom Script to Implement Consistent Backup for SAP HANA
- Using a Custom Script to Implement Consistent Backup for Other Linux Applications
- Troubleshooting a Custom Script Error
- Verifying the Application-Consistent Backup Result (Linux)
- Verifying the Application-Consistent Backup Result (Windows)
- Protecting SQL Server in Failover Cluster Mode
- Protecting SQL Server in Always on Availability Groups Mode
- Change History
-
Using a Custom Script to Implement Application-Consistent Backup
-
User Guide (Paris)
- Service Overview
- Getting Started
- Vault Management
- Backup Management
- Policy Management
- Restoring Data
- Application-Consistent Backup
- (Optional) Migrating Resources from CSBS/VBS
- Managing Tasks
- Monitoring
- Auditing
- Quotas
-
FAQs
- Concepts
-
Backup
- Do I Need to Stop the Server Before Performing a Backup?
- Can I Back Up a Server Deployed with Databases?
- How Can I Distinguish Automatic Backups From Manual Backups?
- Can I Choose to Back Up Only Some Partitions of a Disk?
- Does CBR Support Cross-Region Backup?
- Can I Back Up Two Disks to One Target Disk?
- How Do I Replicate a Disk to the Same AZ in a Region as the Source Disk?
- Will the Server Performance Be Affected If I Delete Its Backups?
- Can I Use Its Backup for Restoration After a Resource Is Deleted?
- How Many Backups Can I Create for a Resource?
- Can I Use an Incremental Backup to Restore Data After a Full Backup Is Deleted?
- Can I Stop an Ongoing Backup Task?
- How Do I Reduce the Vault Space Occupied by Backups?
- How Do I View the Size of Each Backup?
- How Do I View My Backup Data?
- How Long Will My Backups Be Kept?
- Capacity
-
Restoration
- Do I Need to Stop the Server Before Restoring Data Using Backups?
- Can I Use a System Disk Backup to Recover an ECS?
- Do I Need to Stop the Server Before Restoring Data Using Disk Backups?
- Can a Server Be Restored Using Its Backups After It Is Changed?
- Can a Disk Be Restored Using Its Backups After Its Capacity Is Expanded?
- What Can I Do if the Password Becomes a Random One After I Use a Backup to Restore a Server or Use an Image to Create a Server?
- What Changes Will Be Made to the Original Backup When I Use the Backup to Restore a Server?
- How Do I Restore Data to a New Server?
- How Do I Restore a Data Disk Backup to a System Disk?
- Can I Stop an Ongoing Restoration Task?
-
Policies
- How Do I Configure Automatic Backup for a Server or Disk?
- Why the New Retention Rule I Changed Is Not Applied?
- How Do I Back Up Multiple Resources at a Time?
- How Do I Retain My Backups Permanently?
- How Can I Cancel Auto Backup or Auto Replication?
- How Can I Have the System Automatically Delete Backups That I No Longer Need?
- Why Aren't My Backups Deleted Based on the Retention Rule?
- Optimization
-
Others
- Is There a Quota for CBR Vaults?
- Can I Merge My Vaults?
- How Do I Delete a Backup That Has Been Used to Create an Image While Retaining the Image?
- Can I Export Disk Backup Data to Another Server?
- Why Do I Need a Vault to Accept the Image Shared to Me?
- Can I Download Backup Data to a Local PC?
- How Do I Copy Disk Data to Another Account?
- Troubleshooting Cases
- Appendix
- API Reference (Paris)
-
Best Practices (Paris)
-
Using a Custom Script to Implement Application-Consistent Backup
- Using a Custom Script to Implement Consistent Backup for MySQL
- Using a Custom Script to Implement Consistent Backup for SAP HANA
- Using a Custom Script to Implement Consistent Backup for Other Linux Applications
- Troubleshooting a Custom Script Error
- Verifying the Application-Consistent Backup Result (Linux)
- Verifying the Application-Consistent Backup Result (Windows)
- Protecting SQL Server in Failover Cluster Mode
- Protecting SQL Server in Always on Availability Groups Mode
- Performing Periodic Recovery Drills Using the Backup Data
- Creating Backup Policies Based on Service Tiering
- Change History
-
Using a Custom Script to Implement Application-Consistent Backup
-
User Guide (Kuala Lumpur Region)
- Service Overview
- Getting Started
- Permissions Management
- Vault Management
- Backup Management
- Policy Management
- Restoring Data
- Application-Consistent Backup
- Managing Tasks
- Monitoring
- Quotas
-
FAQs
- Concepts
-
Backup
- Do I Need to Stop the Server Before Performing a Backup?
- Can I Back Up a Server Deployed with Databases?
- How Can I Distinguish Automatic Backups From Manual Backups?
- Can I Choose to Back Up Only Some Partitions of a Disk?
- Does CBR Support Cross-Region Backup?
- Will the Server Performance Be Affected If I Delete Its Backups?
- Can I Use Its Backup for Restoration After a Resource Is Deleted?
- How Many Backups Can I Create for a Resource?
- Can I Stop an Ongoing Backup Task?
-
Restoration
- Do I Need to Stop the Server Before Restoring Data Using Backups?
- Can I Use a System Disk Backup to Recover an ECS?
- Do I Need to Stop the Server Before Restoring Data Using Disk Backups?
- Can a Server Be Restored Using Its Backups After It Is Changed?
- Can a Disk Be Restored Using Its Backups After Its Capacity Is Expanded?
- What Can I Do if the Password Becomes a Random One After I Use a Backup to Restore a Server or Use an Image to Create a Server?
- What Changes Will Be Made to the Original Backup When I Use the Backup to Restore a Server?
- Can I Stop an Ongoing Restoration Task?
- Policies
- Others
- Troubleshooting Cases
- Appendix
- API Reference (Kuala Lumpur Region)
-
Best Practices (Kuala Lumpur Region)
-
Using a Custom Script to Implement Application-Consistent Backup
- Using a Custom Script to Implement Consistent Backup for MySQL
- Using a Custom Script to Implement Consistent Backup for SAP HANA
- Using a Custom Script to Implement Consistent Backup for Other Linux Applications
- Troubleshooting a Custom Script Error
- Verifying the Application-Consistent Backup Result (Linux)
- Verifying the Application-Consistent Backup Result (Windows)
- Protecting SQL Server in Failover Cluster Mode
- Protecting SQL Server in Always on Availability Groups Mode
- Change History
-
Using a Custom Script to Implement Application-Consistent Backup
-
User Guide (Ankara Region)
- Service Overview
- Getting Started
- Permissions Management
- Vault Management
- Backup Management
- Policy Management
- Restoring Data
- Application-Consistent Backup
- Managing Tasks
- Monitoring
- Quotas
-
FAQs
- Concepts
-
Backup
- Do I Need to Stop the Server Before Performing a Backup?
- Can I Back Up a Server Deployed with Databases?
- How Can I Distinguish Automatic Backups From Manual Backups?
- Can I Choose to Back Up Only Some Partitions of a Disk?
- Does CBR Support Cross-Region Backup?
- Will the Server Performance Be Affected If I Delete Its Backups?
- Can I Use Its Backup for Restoration After a Resource Is Deleted?
- How Many Backups Can I Create for a Resource?
- Can I Stop an Ongoing Backup Task?
- Capacity
-
Restoration
- Do I Need to Stop the Server Before Restoring Data Using Backups?
- Can I Use a System Disk Backup to Recover an ECS?
- Do I Need to Stop the Server Before Restoring Data Using Disk Backups?
- Can a Server Be Restored Using Its Backups After It Is Changed?
- Can a Disk Be Restored Using Its Backups After Its Capacity Is Expanded?
- What Can I Do if the Password Becomes a Random One After I Use a Backup to Restore a Server or Use an Image to Create a Server?
- What Changes Will Be Made to the Original Backup When I Use the Backup to Restore a Server?
- Can I Stop an Ongoing Restoration Task?
- Policies
- Others
- Troubleshooting Cases
- Appendix
- API Reference (Ankara Region)
-
Best Practices (Ankara Region)
-
Using a Custom Script to Implement Application-Consistent Backup
- Using a Custom Script to Implement Consistent Backup for MySQL
- Using a Custom Script to Implement Consistent Backup for SAP HANA
- Using a Custom Script to Implement Consistent Backup for Other Linux Applications
- Troubleshooting a Custom Script Error
- Verifying the Application-Consistent Backup Result (Linux)
- Verifying the Application-Consistent Backup Result (Windows)
- Protecting SQL Server in Failover Cluster Mode
- Protecting SQL Server in Always on Availability Groups Mode
- Change History
-
Using a Custom Script to Implement Application-Consistent Backup
-
User Guide (ME-Abu Dhabi Region)
- Glossary
- General Reference
Copied.
Authentication
- Token authentication: Requests are authenticated using tokens.
- AK/SK authentication: Requests are encrypted using AK/SK pairs. AK/SK authentication is recommended because it is more secure than token authentication.
Token Authentication
The validity period of a token is 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API used to obtain a user token.
A token specifies temporary permissions in a computer system. During API authentication using a token, the token is added to requests to get permissions for calling the API. You can obtain a token by calling the Obtaining User Token API.
CBR is a project-level service. When you call the API, set auth.scope in the request body to project.
{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", // IAM user name "password": "********", // IAM user password "domain": { "name": "domainname" // Name of the account to which the IAM user belongs } } } }, "scope": { "project": { "name": "xxxxxxxx" // Project Name } } } }
After a token is obtained, the X-Auth-Token header field must be added to requests to specify the token when calling other APIs. For example, if the token is ABCDEFJ...., X-Auth-Token: ABCDEFJ.... can be added to a request as follows:
1 2 3 |
POST https://{{endpoint}}/v3/auth/projects Content-Type: application/json X-Auth-Token: ABCDEFJ.... |
AK/SK Authentication
An AK/SK is used to verify the identity of a request sender. In AK/SK authentication, a signature needs to be obtained and then added to requests.
AK: access key ID, which is a unique identifier used in conjunction with a secret access key to sign requests cryptographically.
SK: secret access key, which is used in conjunction with an AK to sign requests cryptographically. It identifies a request sender and prevents the request from being modified.
The following uses a demo project to show how to sign a request and use an HTTP client to send an HTTPS request.
Download the demo project at https://github.com/api-gate-way/SdkDemo.
If you do not need the demo project, visit the following URL to download the API Gateway signing SDK:
Obtain the API Gateway signing SDK from the enterprise administrator.
Decompress the downloaded package and reference the obtained JAR files as dependencies.

- Generate an AK/SK. (If an AK/SK file has already been obtained, skip this step and locate the downloaded AK/SK file. Generally, the file name will be credentials.csv.)
- Log in to the management console.
- Hover over the username in the upper right corner and choose My Credentials from the drop-down list.
- In the navigation pane, choose Access Keys.
- Click Add Access Key.
- Enter an access key description and click OK.
- Enter the verification code your email, mobile phone, or virtual MFA device received and click OK.
NOTE:
A verification code is required only when you have enabled operation protection. If operation protection is not enabled, you can skip this substep.
- Download the access key file.
NOTE:
Keep the access key secure.
- Download and decompress the demo project.
- Import the demo project to Eclipse.
Figure 2 Selecting Existing Projects into WorkspaceFigure 3 Selecting the demo projectFigure 4 Structure of the demo project
- Sign the request.
The request signing method is integrated in the JAR files imported in 3. The request needs to be signed before it is sent. The signature will then be added as part of the HTTP header to the request.
The demo code is classified into the following classes to demonstrate signing and sending the HTTP request:
- AccessService: An abstract class that merges the GET, POST, PUT, and DELETE methods into the access method.
- Demo: Execution entry used to simulate the sending of GET, POST, PUT, and DELETE requests.
- AccessServiceImpl: Implements the access method, which contains the code required for communication with API Gateway.
- Edit the main method in the Demo.java file, and replace the bold text with actual values.
If you use other methods such as POST, PUT, and DELETE, see the corresponding comment.
Specify region, serviceName, ak/sk, and url as the actual values. In this demo, the URLs for accessing VPC resources are used.
To obtain the project ID in the URLs, see Obtaining a Project ID.
To obtain the endpoint, contact the enterprise administrator.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
//TODO: Replace region with the name of the region in which the service to be accessed is located. private static final String region = ""; //TODO: Replace vpc with the name of the service you want to access. For example, ecs, vpc, iam, and elb. private static final String serviceName = ""; public static void main(String[] args) throws UnsupportedEncodingException { //TODO: Replace the AK and SK with those obtained on the My Credentials page. String ak = "ZIRRKMTWP******1WKNKB"; String sk = "Us0mdMNHk******YrRCnW0ecfzl"; //TODO: To specify a project ID (multi-project scenarios), add the X-Project-Id header. //TODO: To access a global service, such as IAM, DNS, CDN, and TMS, add the X-Domain-Id header to specify an account ID. //TODO: To add a header, find "Add special headers" in the AccessServiceImple.java file. //TODO: Test the API String url = "https://{Endpoint}/v1/{project_id}/vpcs"; get(ak, sk, url); //TODO: When creating a VPC, replace {project_id} in postUrl with the actual value. //String postUrl = "https://serviceEndpoint/v1/{project_id}/cloudservers"; //String postbody ="{\"vpc\": {\"name\": \"vpc\",\"cidr\": \"192.168.0.0/16\"}}"; //post(ak, sk, postUrl, postbody); //TODO: When querying a VPC, replace {project_id} in url with the actual value. //String url = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}"; //get(ak, sk, url); //TODO: When updating a VPC, replace {project_id} and {vpc_id} in putUrl with the actual values. //String putUrl = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}"; //String putbody ="{\"vpc\":{\"name\": \"vpc1\",\"cidr\": \"192.168.0.0/16\"}}"; //put(ak, sk, putUrl, putbody); //TODO: When deleting a VPC, replace {project_id} and {vpc_id} in deleteUrl with the actual values. //String deleteUrl = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}"; //delete(ak, sk, deleteUrl); }
- Compile the code and call the API.
In the Package Explorer area on the left, right-click Demo.java, choose Run AS > Java Application from the shortcut menu to run the demo code.
You can view API call logs on the console.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot