阿里云-访问控制服务SDK使用手册
阿里云CLI Python版本用户指南说明书

CLI Python VersionUser GuideUser GuideAlibaba Cloud Python SDKsSee the Python SDKs of different Alibaba Cloud products and the commands for installing the SDKs in SDK document Python SDK.Scripts usage samplesUse Shell scriptAlibaba Cloud CLI is a tool for the unified management and configuration of Alibaba Cloud resources. After you install and configure Alibaba Cloud CLI, you can use it to manage multiple Alibaba Cloud products and services simultaneously.To facilitate your use of Alibaba Cloud CLI, we have compiled a script integrating common operations. This document shows how to run the sample Shell script in the Linux operating system.Install and configure Alibaba Cloud CLI.For more information about the installation and configuration procedures, see AlibabaCloud CLI installation guide (Linux/UNIX/Mac OS) and Configuration of Alibaba Cloud CLI.Click here to download the script.Run the following command to extract the downloaded script package.tar zxvf ecs.tar.gzsh ecs.shSelect the operation that you want to perform:The following figure shows the operations that you can select in the first directory:The following figure shows the operations that you can select in the seconddirectory:Query information of the subscribed image market imagesYou can run the following script in Alibaba Cloud CLI to query information (image IDs and names) of all subscribed image market images. You can download or edit the script.Click to download the script: querySubscribedImageId.zipThe script is as follows:`#!/bin/bashtcount=`aliyuncli ecs DescribeImages --ImageOwnerAlias marketplace --output json --filter TotalCount`pageNum=1cat /dev/null >/tmp/imageids.txtwhile ((tcount>0))doaliyuncli ecs DescribeImages --ImageOwnerAlias marketplace --filter Images.Image[*].ImageId --PageSize 100 --PageNumber $pageNum --output json --filter Images.Image[*].ImageId | sed '1d' | sed '$d' | sed 's/,//g' | sed's/"//g'| sed 's/ //g'>>/tmp/imageids.txtlet pageNum++let tcount-=100donecat /tmp/imageids.txt | while read linedoisSubscribed=`aliyuncli ecs DescribeImages --ImageOwnerAlias marketplace --ImageId $line --filterImageIds.Image[*] --filter Images.Image[*].IsSubscribed --output json | sed '1d' | sed '$d' | sed 's/ //g'`if [[ $isSubscribed = "true" ]];thenecho $line `aliyuncli ecs DescribeImages --ImageOwnerAlias marketplace --ImageId $line --filter ImageIds.Image[*] --filter Images.Image[*].ImageName --output json | sed '1d' | sed '$d' | sed 's/ //g'` >>imagesInfo.txtfidonenative2ascii -encoding UTF-8 -reverse imagesInfo.txt imagesInfoCN.txtrm -rf imagesInfo.txtcat imagesInfoCN.txt`After editing or downloading the script and granting the permission (by running the chmod + x command), you can run the script in the following format to generate an imagesInfoCN.txt file containing information of subscribed image market images in the directory storing the script.Example:./querySubscribedImageId.shSample output:# ./querySubscribedImageId.shm-23917oqoi "ASP/.NET runtime environment (Windows 2008 64-bit|IIS7.0) V1.0"m-23n2589vc "Java runtime environment (Centos 64-bit|OpenJDK1.7) V1.0"m-23u9mjjtk "PW website construction system (Centos 64-bit) V1.0"Query all instance IDs in a specified region and export them to a fileYou can run the script below in Alibaba Cloud CLI to query all instance IDs in a specified region, and export them to a file. You can choose to download or edit the script.Click to download the script: getVmList.zipThe script is as follows.#!/bin/bashtcount=`aliyuncli ecs DescribeInstances --RegionId $1 --output json --filter TotalCount`pageNum=1cat /dev/null >vmList.txtwhile ((tcount>0))doaliyuncli ecs DescribeInstances --RegionId $1 --PageSize 100 --PageNumber $pageNum --output json --filter Instances.Instance[*].InstanceId | sed '1d' | sed '$d' | sed 's/,//g' | sed 's/"//g'| sed 's/ //g'>>vmList.txtlet pageNum++let tcount-=100donecat vmList.txtAfter you edit or download the script and grant the permission (by running the chmod + x command), you can run the script in the following format to generate a vmList.txt file containing required instance IDs in the directory storing the script.Format:./getVmList.sh <Region ID>Note: You can obtain the Region ID through the DescribeRegions interface.Example:./getVmList.sh cn-hangzhouSample output:#./getVmList.sh cn-hangzhoucn-hangzhou sg-227f611sscn-hangzhou sg-22esa2s7sQuery the VPC instance ID list with no VSwitch created in all regionsYou can run the following script in Alibaba Cloud CLI to query the VPC instance ID list with no VSwitch created in all regions. You can download or edit the script.Click to download the script: getNoVSWitchVpcIds.zip.The script is as follows:#!/bin/bashfor RegionId in `aliyuncli ecs DescribeRegions --filter Regions.Region[*].RegionId --output json | sed '1d' | sed '$d' | sed 's/,//g' | sed 's/"//g'| sed 's/ //g'`docat /dev/null >/tmp/vpcIDs.txtpageNum=1tcount=`aliyuncli ecs DescribeVpcs --RegionId $RegionId --output json --filter TotalCount`while ((tcount>0))doaliyuncli ecs DescribeVpcs --RegionId $RegionId --filter Vpcs.Vpc[*].VpcId --PageSize 50 --PageNumber $pageNum --output json | sed '1d' | sed '$d' | sed 's/,//g' | sed 's/"//g'| sed 's/ //g'>>/tmp/vpcIDs.txtlet pageNum++let tcount-=50donecat /tmp/vpcIDs.txt | while read linedovSwitchCount=`aliyuncli ecs DescribeVSwitches --VpcId $line --output json --filter TotalCount`if [[ $vSwitchCount -eq 0 ]];thenecho $RegionId $linefidonedoneAfter editing or downloading the script and granting the permission (by running the chmod + x command), you can run the script in the following format to export the VPC instance IDs (in pairs) with no VSwitch created in all regions in the Region ID VpcId format by region.Format:./getNoVSWitchVpcIds.shSample output:[root@AliyunTest]# ./getNoVSWitchVpcIds.shcn-hangzhou vpc-23vyarrssQuery IDs of security groups not associated with any instances in all regionsYou can run the following script in Alibaba Cloud CLI to query security groups not associated withany instances in all regions and perform operations (such as DELETE) on the security groups. You can download or edit the script.Click to download the script: getUnUsedSecurityGroupId.zip.The script is as follows:#!/bin/bashfor RegionId in `aliyuncli ecs DescribeRegions --filter Regions.Region[*].RegionId --output json | sed '1d' | sed '$d' | sed 's/,//g' | sed 's/"//g'| sed 's/ //g'`docat /dev/null >/tmp/UnUsedSecurityGroupIds.txtpageNum=1tcount=`aliyuncli ecs DescribeSecurityGroups --RegionId $RegionId --output json --filter TotalCount`while ((tcount>0))doaliyuncli ecs DescribeSecurityGroups --RegionId $RegionId --filter SecurityGroups.SecurityGroup[*].SecurityGroupId --PageSize 100 --PageNumber $pageNum --output json | sed '1d' | sed '$d' | sed 's/,//g' | sed 's/"//g'| sed 's///g'>>/tmp/UnUsedSecurityGroupIds.txtlet pageNum++let tcount-=100donecat /tmp/UnUsedSecurityGroupIds.txt | while read linedousedVMCount=`aliyuncli ecs DescribeInstances --RegionId $RegionId --SecurityGroupId $line --output json --filter TotalCount`if [[ $usedVMCount -eq 0 ]];thenecho $RegionId " " $linefidonedoneAfter editing or downloading the script and granting the permission (by running the chmod + x command), you can run the script in the following format to export IDs of security groups (in pairs) not associated with any instances in all regions by region and security group.Format:./getUnUsedSGInfo.shSample output:[root@AliyunTest]# ./getUnUsedSGInfo.shcn-qingdao sg-227f61ltscn-shenzhen sg-22esa0f7sStructure and parameters of the command lineOnline help commandFor ease of use, Alibaba Cloud CLI provides online help commands. You can use the help commands to query valid operations supported by Alibaba Cloud products.For instance, if you want to query all the operations supported by ECS, run aliyuncli ecs help command and the query result is shown as follows.If you want to query the parameters of an ECS operation, run aliyuncli ecs <operation name> help. Taking the DescribeRegions operation as an example, the query result is shown as follows.Alibaba Cloud CLI command structureThe Alibaba Cloud CLI command structure is as follows.aliyuncli <command> <subcommand> [options and parameters]aliyuncli: Alibaba Coud CLI, the tool name of Alibaba Cloud.command: a top-layer command which represents an Alibaba Cloud basic service supported by Alibaba Cloud CLI (such as ECS/RDS/SLB/OSS), or a command of Alibaba Cloud CLI (such as “help” and “configure”).subcommand: a subcommand that specifies an operation to be executed, that is, a specificoperation.options and parameters: the parameter list corresponding to the operation specified insubcommand. The ordering of the parameters has no impact on the use of commands.Various types of input values can be used, such as numbers, strings, lists, mappings, andJSON structures.Examples:aliyuncli rds DescribeDBInstances --PageSize 50aliyuncli ecs DescribeRegionsaliyuncli rds DescribeDBInstanceAttribute --DBInstanceId xxxxxxParameter value input requirementsWhen you are calling Alibaba Cloud CLI, you must input the required values according to the following instructions to avoid errors.In most cases, you are required to input a string or numeric value to Alibaba Cloud CLI.Example:$ aliyuncli ecs DescribeInstanceAttribute --InstanceId myInstanceIdIf your inputs contain spaces, use single quotation mark (‘) to include the value. This manner is applicable to Windows PowerShell, Mac OS, and Linux.Example:$ aliyuncli ecs DescribeInstanceAttribute --InstanceId 'my instance id'For Windows Command Processer, use double quotation marks (“) to include the value.Example:> aliyuncli ecs DescribeInstanceAttribute --InstanceId "my instance id"Use JSON format to input parameters. JSON format is allowed in Alibaba Cloud CLI. Especially, when you query information of multiple instances or multiple disks, you can input multiple ID values in JsonArray format. It requires that you strictly edit data in JSON format and perform special processing on double quotation marks (“) in JSON format.To query information of multiple instances, you can input values with double quotation marks (“), like [“my-intances-id1”, “my-instances-id2”]. However, in Python, the double quotation marks (“) are filtered out by default, so special processing is required.On Linux and Mac OS systems, use single quotation mark (‘) to include the entireJSON value.Example:$ aliyuncli ecs DescribeInstances --InstanceIds '["my-intances-id1", "my-instances-id2"]'In Windows Command Processer, use a backslash ( \ ) to represent the doublequotation mark (“), and use double quotation marks (“) to include the entireJSON value.Example:> aliyuncli ecs DescribeInstances --InstanceIds "[\"my-intances-id1\", \"my-instances-id2\"]"In Windows PowerShell, use a backslash ( \ ) to represent the double quotationmark (“), and then use single quotation mark (‘) to include the entire JSON value.Example:> aliyuncli ecs DescribeInstances --InstanceIds '[\"my-intances-id1\", \"my-instances-id2\"]' Command output formatOutput formatTo meet different output format requirements of different users, Alibaba Cloud CLI supports three output formats.JSON (json)JSON format is the default output format of Alibaba Cloud CLI. Most languages have theinternal function or open JSON parser library to parse JSON strings easily. JSON format ismainly used with other scripts or any programming language to facilitate developers’parsing and use. An example is shown as follows.Text separated by Tab (text)In text format, outputs of Alibaba Cloud CLI are arranged into lines separated by Tab. This format is appropriate for traditional UNIX text tools (such as sed, grep, and awk) and Windows PowerShell. The text output format complies with the basic structure shown in the following example. The columns are sorted alphabetically by key names of bottom-layerJSON objects.In table format, data is arranged in an easy-to-read manner. An example is shown as follows.Set the output formatThe output format can be specified in two ways.Method 1: Modify the config file.Use the output option in the config file. The following example shows how to set the output formatto text.Method 2: Use command line.Use the output option in Alibaba Cloud CLI. The following example shows how to set the output format to table.Global parameter descriptionWhen you are using Alibaba Cloud CLI, you can set temporary settings for global parameters. You canadjust the parameters as needed. Currently, the supported global parameters are as follows:AccessKeyId: Specifies the AccessKeyId in the API request for executing the currentcommand. If no value is specified or the value is null, the default global AccessKeyId is[default] output=text $ aliyuncli ecs DescribeInstanceAttribute --InstanceId i-23rjh06vf --output tableapplied.AccessKeySecret: Specifies the AccessKeySecret in the API request for executing the current command. If no value is specified or the value is null, the default global AccessKeySecret isapplied.RegionId: Specifies the region corresponding to the API request for executing the currentcommand. If no value is specified, the global RegionId is applied.output: Specifies the display format for executing the current command.profile: Specifies the account used for executing the current command. If the specifiedaccount does not exist, the default account is used. In addition, if profile appears togetherwith other global parameters, its priority is lower. For example, if profile appears togetherwith AccessKeyId, AccessKeyId is selected as the AccessKey preferentially.version: Specifies the open API version used for executing the current command. If no value is specified, the latest version installed in the system is used.Note: If the parameter directly follows Alibaba Cloud CLI, the current version of AlibabaCloud CLI is displayed.Multi-account useMulti-account useNotices: This feature is useful for users who need to manage many accoutns and many devices. If you only need to manage an accout, ignore this feature.Alibaba Cloud CLI supports multi-account systems. You can configure multiple access keys and secret values, region and output as needed, to meet your different requirements more flexibly. For the information about how to configure accouts in Alibaba Cloud CLI, refer to Configuration of Alibaba Cloud CLI (for Alibaba Cloud users).Basic command structureThe basic command structure of multi-accout management is shown as follows:aliyuncli configure [set/get/list] --profile profilename --key value --key1 value1configure: Manage configurations.set: Set a configuration value. Optional.get: Display a configuration value. Optional.list: List all values of a profile. Optional.profile: Profile used in the current operation, which is a global parameter. For details, refer to the description of profile in Global parameter description. If this option is not included, adefault account is used.key: Specific key for configuring a profile.Value: Value being configured, which is behind key.Accout typeThere are two kinds of accounts in the config file: [default] account and [profile profilename] account. In Alibaba Cloud CLI, if the option profile is not included, the [default] account is used; if the option profile profilename is included, [profile profilename] is used.The following shows the examples of profile:aliyuncli configure ←Configure [default] account quicklyaliyuncli configure --profile test ←Configure [profile test] account quicklyThe following shows the examples of set:aliyuncli configure set --output table --region cn-qingdao ←Set [default] account, output=table, region=cn-qingdaoaliyuncli configure set --output json --region cn-hangzhou --profile test1 ←Set [profile test1] account, output = json, region = cn-hangzhouThe following shows the examples of get:Output: region = cn-hangzhouOutput:output = jsonregion = cn-hangzhouThe following shows the examples of list:The output is as follows:Advanced filter functionNote : This feature is used for users who have many instances. If you have only one instance, ignorethis feature.Data returned upon Alibaba Cloud API calls can be presented in different formats, but it is alsocomplex. Alibaba Cloud CLI further provides the data filter function, allowing you to filter data usingfilters. The filter function can help you obtain the expected value from the result, and can be used tohandle results easily and quickly in use or secondary development.Data returned upon API calls is in JSON format by default. Therefore, when using Alibaba Cloud CLI,aliyuncli configure get region ←Get the region of [default] accountaliyuncli configure get output region ←Get the output and region values of [default] accountaliyuncli configure get region --profile profile1 ←Get the region under [profile profile1] accountaliyuncli configure list ←List information under [default] accountaliyuncli configure list --profile profile1 ←List information under [profile profile1] accountyou can use the filter function according to JSON characteristics to obtain your expected results.Taking ECS DecribeRegions for example, run the following command, and the original JSON format output is shown as follows.aliyuncli ecs DescribeRegions --output jsonFilter 1You can enter a key value for filtering. Run the following command, and the filter output is shown as follows.aliyuncli ecs DescribeRegions –output json –filter RegionsFilter 2If the JSON value is an array, the array subscript format is supported. Run the following command,and the filter output is shown as follows.Especially, Alibaba Cloud CLI also supports ‘*’, representing the set of all results. Multiple filterresults are returned as an array. Run the following command, and the filter output is shown as follows.Filter 3 Filter one value from the returned data. Run the following command, and the filter output is shown asaliyuncli ecs DescribeRegions –output json –filter Regions.Region[0]aliyuncli ecs DescribeRegions –output json –filter Regions.Region[*].RegionIdfollows.aliyuncli ecs DescribeRegions –output json –filter Regions.Region[3].RegionId。
阿里云-性能测试服务SDK手册

方法:valuesFromTextBetween
定义:def setKeepAlive(flag) 设置底层HTTP客户端引擎在发送请求时使用长连接还是短连接,默认使用长连接,flag为True或者False。 示例:
# 强制HTTP客户端引擎使用短连接,每次循环之后关闭连接 PTS.HttpUtilities.setKeepAlive(False)
if(not PTS.HttpUtilities.checkResponse([200,300], "test")): PTS.Data.forCurrentTest.success = False
类:Thread
方法:sleep
定义:def sleep(millis) 当前调用方法的线程进入睡眠状态,millis毫秒。 示例:
定义: delayReports,"0"表示事务数据收集完之后立即汇报,"1"表示将数据收集延迟汇报,通常我们需要在脚本中 根据请求返回内容对事务是否成功进行判断,所以需要将该开关设置为"1"。 示例:
# 延迟汇报数据 PTS.Data.delayReports = 1 # 事务调用 ………… ……… # 汇报数据 PTS.Data.report() # 关闭延迟回报数据 PTS.Data.delayReports = 0
方法:setUrlEncoding
定义:def setUrlEncoding(code)
快速上手阿里云ossSDK

快速上⼿阿⾥云ossSDK使⽤阿⾥云oss SDK依赖安装:pip install oss2pip install aliyun-python-sdk-sts版本最好是 2.7.5 或以上如果要开启 crc64 循环冗余校验,需要先将 crcmod 安装好。
安装 python-devel 执⾏ yum install python-devel。
需要循环冗余校验,安装 crcmod 执⾏ pip install crcmod。
获取AccessKeyId和AccessKeySecret:1. 登录阿⾥云控制台。
2. 将⿏标放在右上⽅的⽤户名区域,在弹出的快捷菜单中选择accesskeys。
3. 系统弹出安全提⽰对话框,单击继续使⽤AccessKey。
页⾯显⽰AccessKeyId和AccessKeySecret。
快速创建⼦账号AccessKey:1. 使⽤主账号登录阿⾥云控制台。
2. 将⿏标置于页⾯右上⽅的账号图标,然后单击accesskeys。
3. 在安全提⽰框中,单击开始使⽤⼦⽤户AccessKey。
4. 填写RAM⽤户名,然后单击下⼀步。
5. 给RAM⽤户授予相关权限,例如AliyunOSSFullAccess将给RAM⽤户授予OSS的管理权限。
单击开始创建。
6. 完成⼿机验证后,单击确定。
7. 查看AccessKeyId和AccessKeySecret。
然后单击下载AccessKey,下载AccessKey信息。
整体使⽤⽅法:# -*- coding: utf-8 -*-import oss2endpoint = '' # Suppose that your bucket is in the Hangzhou region.auth = oss2.Auth('<Your AccessKeyID>', '<Your AccessKeySecret>')bucket = oss2.Bucket(auth, endpoint, '<your bucket name>')# The object key in the bucket is story.txtkey = 'story.txt'# Uploadbucket.put_object(key, 'Ali Baba is a happy youth.')# Downloadbucket.get_object(key).read()# Deletebucket.delete_object(key)# Traverse all objects in the bucketfor object_info in oss2.ObjectIterator(bucket):print(object_info.key)创建存储空间:# -*- coding: utf-8 -*-import oss2# 阿⾥云主账号AccessKey拥有所有API的访问权限,风险很⾼。
阿里云操作手册

阿里云是阿里巴巴集团旗下的云计算服务提供商,提供包括计算、存储、数据库、网络、安全等多种云服务。
操作阿里云需要按照具体的服务和需求进行操作,以下是一般性的阿里云基本操作手册的大致内容:1. 注册和登录:-注册阿里云账号。
-登录阿里云控制台。
2. 云服务器(ECS)操作:-创建和配置云服务器实例。
-安全组设置和网络配置。
-远程连接和管理服务器。
3. 存储服务操作:-使用对象存储服务(OSS)上传和下载文件。
-使用块存储服务(EBS)管理云硬盘。
-配置文件存储服务(NAS)。
4. 数据库服务操作:-创建和管理云数据库(RDS)。
-使用NoSQL数据库服务(Table Store)。
-设置和管理缓存服务(Redis)。
5. 网络服务操作:-配置和管理云网络(VPC)。
-设置弹性公网IP和负载均衡。
-配置安全组和访问控制。
6. 域名和网站操作:-注册和管理域名。
-配置CDN加速服务。
-部署和管理云主机上的网站。
7. 安全和监控:-设置访问控制和权限。
-使用安全服务(WAF、安骑士)。
-配置监控和警报。
8. 容器服务操作:-使用容器服务(Kubernetes)部署和管理容器应用。
-使用容器镜像服务(Container Registry)。
9. Serverless服务操作:-使用函数计算(Function Compute)。
-设置API网关和消息服务(MNS)。
10. 开发者工具:-使用阿里云命令行工具CLI。
-使用开发者工具(SDK)进行开发。
11. 财务管理:-查看和管理费用和账单。
-设置预算和报警。
12. 升级和扩展:-升级和扩展云资源。
-了解和使用阿里云市场的服务。
请注意,以上是一般性的操作手册大纲,具体的操作步骤和细节可能会因服务类型和版本的不同而有所变化。
建议查阅阿里云官方文档,以获取最准确和最新的操作指南。
阿里云SDK手册之javaSDK

阿⾥云SDK⼿册之javaSDK进⾏阿⾥云sdk开发的前提是已经购买阿⾥云的相关服务才能调⽤阿⾥的相关接⼝进⾏开发。
最近公司在做云管控的项⽬,于是进⾏下摘录总结。
⼀. 环境准备阿⾥云针对不同的开发语⾔提供不同的sdk,由于项⽬⽤的是java语⾔进⾏开发,所以下载的是java sdk,介绍的也是java sdk的开发⽅式。
1.⾸先下载服务的SDK,阿⾥云Java SDK⽀持J2SE Development Kit (JDK) 1.5或以上版本。
2.安装步骤1. 在解压的⽂件中可以找到 aliyun-sdk-java-online_standard-20141010.jar 这个包;2. 以Eclipse为例导⼊jar包的过程如下:在Eclipse上右键点击⼯程 -> Properties -> Java Build Path -> Libraries -> Add ExternalJARs(netbeans和intellij等其他idea⽤户请⾃⾏按照相应导⼊jar包得⽅法导⼊这个包);3. 选择以上jar包,点击“OK”按钮,经过以上步骤,你就可以在⼯程中使⽤阿⾥云Java SDK了。
⼆.快速⼊门1.初始化⼀个AliyunClient1. 与阿⾥云SDK相关的类都在包com.aliyun.api.AliyunClient下;2. AliyunClient是与API交互的接⼝,SDK的操作都是通过AliyunClient完成的;3. AliyunClient可以复⽤,建议设置成应⽤程序全局唯⼀的;4. ⽤户可以调⽤带有connectTimeout和readTimeout的构造⽅法来设置SDK调⽤接⼝的连接超时时间和读取超时时间,SDK默认的连接超时时间是3秒,读取超时时间是80秒。
⽰例代码如下:import com.aliyun.api.AliyunClient;import com.aliyun.api.DefaultAliyunClient;public class CreateAliyunClientDemo {private static AliyunClient client;static {String serverUrl = "<serverUrl>"; //例如: /String accessKeyId = "<accessKeyId>";String accessKeySecret = "<accessKeySecret>";// 初始化⼀个AliyunClientclient = new DefaultAliyunClient(serverUrl, accessKeyId, accessKeySecret);}public static void main(String[] args) {}}2.SDK调⽤⽰例调⽤步骤:1. 实例化⼀个请求类,根据调⽤API的不同版本实例化不同Java包下的请求类;2. 给请求实例赋值;3. 调⽤接⼝返回调⽤结果。
阿里云-访问控制服务快速入门

1. 进入启用虚拟MFA设备页面,如下图所示:
此操作需要您在智能手机终端上安装虚拟MFA应用程序。常见的MFA应用程序有阿里身份宝或Google Authenticator,用户可以自主选择安装使用。关于Google Authenticator安装问题,请参考Google Authenticator安装及使用指导
在RAM中,您可以指定RAM用户必须设置多因素认证(MFA)。一旦设置MFA,您还可以统一指定是否允许登 录时在其登录设备上保存MFA登录状态(保存7天)。
6
补丁管理/使用手册
给您的员工创建RAM用户账号
当您需要给某个员工授权时,首先需要给该员工创建一个对应的用户身份。
创建RAM用户
操作步骤:登入RAM管理控制台,选择用户管理 -> 新建用户,进入创建用户页面。
1. 在您的MFA应用程序中添加用户
1
Eclipse 插件/使用手册 这里以Google Authenticator为例来描述操作步骤。打开Authenticator -> 点击 +添加用户,然后点击扫码条 形码 进行扫码。(如果您的智能设备不支持扫码功能,那么您也可以点击手输信息获取,在MFA应用程序中以 手动输入MFA密钥的方式进行配置。) 扫码完成后会自动添加用户,然后您的MFA应用会显示账号Alice@example-company的动态口令,每30秒更 新一次,如下图所示:
2
Eclipse 插件/使用手册
1. 获取连续的两组口令 您需要在启用虚拟MFA设备页面中输入MFA应用中显示的连续两组动态口令,然后单击确定启用按钮。如下图
3
所示:
移动数据分析/SDK 手册
阿里云操作手册

阿里云操作手册(最新版)目录1.阿里云操作手册概述2.手册的主要内容3.如何使用阿里云操作手册4.阿里云操作手册的优势正文阿里云操作手册是一款为阿里云用户提供操作指南的工具,它包含了阿里云各种服务的使用说明,可以帮助用户更好地理解和使用阿里云的服务。
下面我们将详细介绍阿里云操作手册的相关内容。
一、阿里云操作手册概述阿里云操作手册是一本针对阿里云服务的操作指南,它包含了阿里云各种服务的使用说明,可以帮助用户更好地理解和使用阿里云的服务。
该手册适用于所有阿里云的用户,无论你是初学者还是专业人士,都可以从中获取所需的信息。
二、手册的主要内容阿里云操作手册主要包括以下内容:1.阿里云服务的介绍:包括阿里云的服务种类、服务特点等。
2.阿里云服务的操作指南:包括如何购买阿里云服务、如何配置阿里云服务、如何使用阿里云服务等。
3.阿里云服务的常见问题解答:包括用户在使用阿里云服务过程中可能会遇到的问题以及解决方法。
三、如何使用阿里云操作手册要使用阿里云操作手册,用户可以按照以下步骤进行:1.登录阿里云官网,进入控制台。
2.在控制台页面,选择“帮助中心”。
3.在帮助中心页面,选择“操作手册”。
4.在操作手册页面,可以根据需要选择相应的服务进行查看。
四、阿里云操作手册的优势阿里云操作手册具有以下优势:1.详细的操作说明:阿里云操作手册包含了各种服务的详细操作说明,可以帮助用户更好地理解和使用阿里云的服务。
2.实时更新:阿里云操作手册会根据阿里云服务的更新情况进行实时更新,保证用户获取到的信息是最新的。
3.多样化的学习方式:阿里云操作手册支持在线查看和下载 PDF 两种方式,用户可以根据自己的需要进行选择。
总的来说,阿里云操作手册是一款非常实用的工具,它可以帮助用户更好地理解和使用阿里云的服务,提高用户的工作效率。
阿里云移动推送 App SDK 手册说明书

--App SDK 手册Android SDK手册使用前必读:移动推送名词解释&约束1. 创建应用到阿里云移动推送控制台创建应用,应用创建完成以后,进入移动推送相关模块进行设置,具体操作请参见 创建APP 。
在应用中完成应用配置,请注意PackageName务必和App的包名一致,否则推送将无法正确初始化。
【注意】使用Gradle构建App时,PackageName的查看:查看AndroidManifest.xml中根元素package属性;查看工程build.gradle中applicationId设置,默认AndroidManifest.xml中的package属性保持一致,如果不一致,以applicationId为准。
2. SDK下载和集成2.1 SDK下载2.2 SDK目录结构OneSDK|-- AndroidManifest.xml|-- build.gradle|-- libs--2.3 SDK集成:请在工程中添加android-support-v4.jar支持包(v2.3.0以上),关于v4支持包的说明请参考:https:///topic/libraries/support-library/features.html#v4;手动拷贝下载SDK中的libs目录,手动拷贝后需要在APP工程的build.gradle中配置jniLibs的目录:3. 配置AndroidManifest.xml3.1 appkey和appsecret配置com.alibaba.app.appkey和com.alibaba.app.appsecret为您App的对应信息,在推送控制台APP列表页的应用证书中获取。
| |-- armeabi| | |-- libcocklogic.so -网络连接库及幽灵进程的辅助lib| | |-- libtnet.so| |-- armeabi-v7a| | |-- libcocklogic.so| | |-- libtnet.so| |-- arm64-v8a| | |-- libcocklogic.so| | |-- libtnet.so| |-- x86| | |-- libcocklogic.so| | |-- libtnet.so| |-- arm64| | |-- libcocklogic.so| | |-- libtnet.so| |-- alicloud-android-push-sdk.jar -移动推送主功能包| |-- alisdk-ut.jar -UT基础包| |-- utdid4all.jar -设备Id生成包|-- project.properties|-- srcandroid {...sourceSets {main {jniLibs.srcDirs = ['libs']}}}<meta-data android:name="com.alibaba.app.appkey" android:value="*****"/> <!-- 请填写你自己的- appKey --><meta-data android:name="com.alibaba.app.appsecret" android:value="****"/> <!-- 请填写你自己的appSecret -->--3.2 Permission 的配置将以下uses-permission片段拷贝进你manifest中的Permission申明区域中:3.3 Service 的配置将以下service片段拷贝进你Manifest中的service申明区域中:<!--阿里移动推送相关权限--><!--Android 6.0版本可去除,用于选举信息(通道复用)的同步--><uses-permission android:name="android.permission.WRITE_SETTINGS" /><!--进行网络访问和网络状态监控相关的权限声明--><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /><!--允许对sd卡进行读写操作--><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><!--网络库使用,当网络操作时需要确保事务完成不被杀掉--><uses-permission android:name="android.permission.WAKE_LOCK" /><!--用于读取手机硬件信息等,用于机型过滤--><uses-permission android:name="android.permission.READ_PHONE_STATE" /><!--选举使用,当应用有删除或者更新时需要重新选举,复用推送通道--><uses-permission android:name="android.permission.BROADCAST_PACKAGE_CHANGED" /><uses-permission android:name="android.permission.BROADCAST_PACKAGE_REPLACED" /><uses-permission android:name="android.permission.RESTART_PACKAGES" /><!--补偿通道小米PUSH使用,不用可去除--><uses-permission android:name="android.permission.GET_TASKS" /><!--补偿通道GCM使用,不使用可去除--><uses-permission android:name="android.permission.GET_ACCOUNTS" /><!--允许监听启动完成事件--><uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /><!--允许访问震动器--><uses-permission android:name="android.permission.VIBRATE" /><!-- 通道保持服务 --><service android:name="com.alibaba.sdk.android.push.ChannelService"android:exported="true" android:process=":channel"><intent-filter><action android:name="com.taobao.accs.intent.action.SERVICE"/></intent-filter><intent-filter><action android:name="org.agoo.android.intent.action.PING_V4" /><category android:name="taobao" /></intent-filter></service><!-- 消息接收服务 --><service android:name="com.alibaba.sdk.android.push.MsgService"android:exported="false"><intent-filter><action android:name="com.taobao.accs.intent.action.RECEIVE" /></intent-filter>3.4 Receiver 的配置将以下receiver片段拷贝进你manifest中的receiver申明区域中:4. Proguard配置 <intent-filter><action android:name="com.alibaba.sdk.android.push.NOTIFY_ACTION" /></intent-filter></service><!-- 连接心跳保持监听器 --><receiver android:name="anet.channel.heartbeat.HeartbeatManager$Receiver" ><intent-filter><action android:name="MAND" /></intent-filter></receiver><!--消息接收监听器--><receiver android:name="com.alibaba.sdk.android.push.MessageReceiver"><intent-filter><action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED"/></intent-filter><intent-filter><action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED"/></intent-filter><intent-filter><action android:name="MAND" /></intent-filter><intent-filter><action android:name="MAND" /></intent-filter><intent-filter><action android:name="org.agoo.android.intent.action.RECEIVE" /></intent-filter><intent-filter><action android:name=".conn.CONNECTIVITY_CHANGE" /></intent-filter><intent-filter><action android:name="ER_PRESENT" /></intent-filter><intent-filter><action android:name="android.intent.action.BOOT_COMPLETED"/></intent-filter><intent-filter><action android:name="android.intent.action.PACKAGE_REMOVED"/><data android:scheme="package"/></intent-filter></receiver>5. 在应用中注册和启动移动推送首先通过PushServiceFactory获取到CloudPushService,然后调用register()初始化并注册云推送通道,并确保Application上下文中进行初始化工作。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
云服务器 ECS/API 参考
RAM SDK使用手册
简介
本文档主要介绍RAM SDK的使用,在使用SDK前您需要阅读《RAM API文档》,了解各个接口的具体功能。
RAM SDK支持的语言或环境
- Java SDK - .Net SDK - Python SDK - PHP S Notes
Version: 2.0.7
2015年11月07日发布 - RAM Java SDK 第一个版本,覆盖RAM所有API
.Net SDK
示例
using System; using Aliyun.Acs.Core; using Aliyun.Acs.Core.Profile; using Aliyun.Acs.Ram.Model.V20150501; namespace ram_net_sdk_sample { class Program { static void Main(string[] args) { // 构建一个 Aliyun Client, 用于发起请求 // 构建Aliyun Client时需要设置AccessKeyId和AccessKeySevcret // RAM是Global Service, API入口位于华东 1 (杭州) , 这里Region填写"cn-hangzhou" IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou", "<access-key-id>", "<access-key-secret>"); DefaultAcsClient client = new DefaultAcsClient(profile);
下载jar包
aliyun-java-sdk-core-2.2.3.jar aliyun-java-sdk-ram-2.0.7.jar
示例
这里以在RAM中创建一个名为alice的子用户为例:
package com.aliyun.ram.sample; import com.aliyuncs.DefaultAcsClient; import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.IClientProfile; // 当前RAM API版本为2015-05-01 import com.aliyuncs.ram.model.v20150501.*; /** * Created by JasonGao on 15/11/4. */ public class RamServiceSample { public static void main(String[] args) { // 构建一个 Aliyun Client, 用于发起请求 // 构建Aliyun Client时需要设置AccessKeyId和AccessKeySevcret // RAM是Global Service, API入口位于华东 1 (杭州) , 这里Region填写"cn-hangzhou" IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", "<AccessKeyId>", "<AccessKeySecret>"); DefaultAcsClient client = new DefaultAcsClient(profile); // 构造"CreateUser"请求 final CreateUserRequest request = new CreateUserRequest(); //设置参数 - UserName request.setUserName("alice"); // 发起请求,并得到response try { final CreateUserResponse response = client.getAcsResponse(request);
2
云服务器 ECS/API 参考
System.out.println("UserName: " + response.getUser().getUserName()); System.out.println("CreateTime: " + response.getUser().getCreateDate()); } catch (ClientException e) { System.out.println("Failed."); System.out.println("Error code: " + e.getErrCode()); System.out.println("Error message: " + e.getErrMsg()); } } }
Java SDK
简介
RAM SDK包含阿里云Java SDK公共部分和RAM部分,公共部分依赖aliyun-java-sdk-core, RAM部分依赖 aliyun-java-sdk-ram。 每个接口的详细使用方法请参考《RAM API文档》
安装
您可以使用Maven仓库引入RAM SDK或手动下载RAM SDK jar后手动添加到项目中。
Maven Dependencies
<dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-ram</artifactId> <version>2.0.7</version>
1
云服务器 ECS/API 参考
</dependency> <dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-core</artifactId> <version>2.2.3</version> </dependency>