Resource Orchestration Service (ROS) supports the following programming languages: Java, Python, PHP, .NET, Go, Node.js, and C++.
The following table lists the download links and usage notes of the SDKs for these languages. For more information, visit OpenAPI Explorer.
ROS SDK download link | References |
Configure access credentials
Linux and macOS
In this example, the ALIBABA_CLOUD_ACCESS_KEY_ID
and ALIBABA_CLOUD_ACCESS_KEY_SECRET
environment variables are configured. You can replace the variable names based on your business requirements, such as OSS_ACCESS_KEY_ID
and OSS_ACCESS_KEY_SECRET
.
Create the
.bash_profile
file.NoteIf you configure environment variables for the first time, you can run the
touch ~/.bash_profile
command to create the configuration file. If the configuration file already exists, run thevim ~/.bash_profile
command to edit the configuration file.touch ~/.bash_profile vim ~/.bash_profile
Configure the
.bash_profile
file.# Replace <ACCESS_KEY_ID> and <ACCESS_KEY_SECRET> in the following commands with your AccessKey ID and AccessKey secret. # Replace the variable names based on your business requirements, such as OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET. export ALIBABA_CLOUD_ACCESS_KEY_ID=<ACCESS_KEY_ID> export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<ACCESS_KEY_SECRET>
Save the file after the configuration.
Use the
.bash_profile
file.# Run the following command in the configuration file. source ~/.bash_profile # Check whether the configuration takes effect. echo $ALIBABA_CLOUD_ACCESS_KEY_ID
If the valid AccessKey pair is returned, the configuration is successful.
After you configure the environment variables, restart your development tools or services, such as the integrated development environment (IDE). Otherwise, the new settings may not take effect as expected.
Windows
In this example, the ALIBABA_CLOUD_ACCESS_KEY_ID
and ALIBABA_CLOUD_ACCESS_KEY_SECRET
environment variables are configured. You can replace the variable names based on your business requirements, such as OSS_ACCESS_KEY_ID
and OSS_ACCESS_KEY_SECRET
.
Use GUI
Procedure
If you want to use GUI to configure environment variables in Windows 10, perform the following steps:
On the Windows desktop, right-click This PC and select Properties. On the page that appears, click Advanced system settings. In the System Properties dialog box, click Environment Variables on the Advanced tab. In the Environment Variables dialog box, click New in the User variables or System variables section. Then, configure the variables described in the following table.
Variable
Example
AccessKey ID
Variable name: ALIBABA_CLOUD_ACCESS_KEY_ID
Variable value: LTAI4GDty8ab9W4Y1D****
AccessKey Secret
Variable name: ALIBABA_CLOUD_ACCESS_KEY_SECRET
Variable value: IrVTNZNy5yQelTETg0cZML3TQn****
Check whether the configuration is successful.
On the Windows desktop, click Start or press Win + R. In the Run dialog box, enter cmd. Then, click OK or press the Enter key. On the page that appears, run the
echo %ALIBABA_CLOUD_ACCESS_KEY_ID%
andecho %ALIBABA_CLOUD_ACCESS_KEY_SECRET%
commands. If the valid AccessKey pair is returned, the configuration is successful.
Use CMD
Procedure
Open a Command Prompt window as an administrator and run the following commands to add environment variables in the operating system:
setx ALIBABA_CLOUD_ACCESS_KEY_ID LTAI4GDty8ab9W4Y1D**** /M setx ALIBABA_CLOUD_ACCESS_KEY_SECRET IrVTNZNy5yQelTETg0cZML3TQn**** /M
/M
indicates that the environment variable is of system level. You cannot use this parameter when you configure a user-level environment variable.Check whether the configuration is successful.
On the Windows desktop, click Start or press Win + R. In the Run dialog box, enter cmd. Then, click OK or press the Enter key. On the page that appears, run the
echo %ALIBABA_CLOUD_ACCESS_KEY_ID%
andecho %ALIBABA_CLOUD_ACCESS_KEY_SECRET%
commands. If the valid AccessKey pair is returned, the configuration is successful.
Use Windows PowerShell
In PowerShell, configure new environment variables. The environment variables apply to all new sessions.
[System.Environment]::SetEnvironmentVariable('ALIBABA_CLOUD_ACCESS_KEY_ID', 'LTAI4GDty8ab9W4Y1D****', [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable('ALIBABA_CLOUD_ACCESS_KEY_SECRET', 'IrVTNZNy5yQelTETg0cZML3TQn****', [System.EnvironmentVariableTarget]::User)
Configure environment variables for all users. You must run the following commands as a administrator.
[System.Environment]::SetEnvironmentVariable('ALIBABA_CLOUD_ACCESS_KEY_ID', 'LTAI4GDty8ab9W4Y1D****', [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('ALIBABA_CLOUD_ACCESS_KEY_SECRET', 'IrVTNZNy5yQelTETg0cZML3TQn****', [System.EnvironmentVariableTarget]::Machine)
Configure temporary environment variables. The environment variables apply only to the current session.
$env:ALIBABA_CLOUD_ACCESS_KEY_ID = "LTAI4GDty8ab9W4Y1D****"
$env:ALIBABA_CLOUD_ACCESS_KEY_SECRET = "IrVTNZNy5yQelTETg0cZML3TQn****"
In PowerShell, run the Get-ChildItem env:ALIBABA_CLOUD_ACCESS_KEY_ID
and Get-ChildItem env:ALIBABA_CLOUD_ACCESS_KEY_SECRET
commands. If the valid AccessKey pair is returned, the configuration is successful.
FAQ
For more information about the FAQ about ROS SDK, see FAQ about SDKs.
Examples
ROS SDK for Java: Use ROS SDK for Java.
ROS SDK for Python: Use ROS SDK for Python.
ROS SDK for other programming languages: OpenAPI Explorer provides the API Documentation module that supports the debugging feature. This feature is available after logon. To view the detailed sample code of an API operation, perform the following operations: Find the documentation of the API operation, click Debug in the Actions column, specify the relevant parameters, and then call the API operation.