Samples

Last Updated: Jul 03, 2017

  1. #!/usr/bin/env python
  2. #coding=utf-8
  3. from aliyunsdkcore import client
  4. from aliyunsdkram.request.v20150501 import CreateUserRequest
  5. # Construct an Aliyun Client for initiating a request
  6. # Set AccessKeyID and AccessKeySevcret when constructing the Aliyun Client
  7. # RAM is a Global Service, and its API ingress is located in the East China 1 (Hangzhou) region. Enter "cn-hangzhou" in "Region"
  8. clt = client.AcsClient('<access-key-id>','<access-key-secret>','cn-hangzhou')
  9. # Construct a "CreateUser" request
  10. request = CreateUserRequest.CreateUserRequest()
  11. # Set the UserName parameter
  12. request.set_UserName('alice')
  13. # Initiate a request and obtain the response
  14. response = clt.do_action(request)
  15. print response
Thank you! We've received your feedback.