salt.cloud.clouds.aliyun

AliYun ECS Cloud 模块

2014.7.0 新版功能.

Aliyun cloud模块用于控制访问aliyun ECS。http://www.aliyun.com/

使用这个模块需要设置 idkey 参数。配置文件在 /etc/salt/cloud.providers/etc/salt/cloud.providers.d/aliyun.conf:

my-aliyun-config:
  # aliyun Access Key ID
  id: wFGEwgregeqw3435gDger
  # aliyun Access Key Secret
  key: GDE43t43REGTrkilg43934t34qT43t4dgegerGEgg
  location: cn-qingdao
  driver: aliyun
depends:requests
salt.cloud.clouds.aliyun.avail_images(kwargs=None, call=None)

返回在服务商的镜像列表

salt.cloud.clouds.aliyun.avail_locations(call=None)

返回一个字典,包含所有在云服务商可用的VM路径和相关数据

salt.cloud.clouds.aliyun.avail_sizes(call=None)

返回一个列表,包含镜像大小

salt.cloud.clouds.aliyun.create(vm_)

从一个字典数据中创建单一的VM

salt.cloud.clouds.aliyun.create_node(kwargs)

Convenience function to make the rest api call for node creation.

salt.cloud.clouds.aliyun.destroy(name, call=None)

Destroy a node.

命令行接口CLI 范例:

salt-cloud -a destroy myinstance
salt-cloud -d myinstance
salt.cloud.clouds.aliyun.get_configured_provider()

Return the first configured instance.

salt.cloud.clouds.aliyun.get_dependencies()

Warn if dependencies aren't met.

salt.cloud.clouds.aliyun.get_image(vm_)

Return the image object to use

salt.cloud.clouds.aliyun.get_location(vm_=None)
Return the aliyun region to use, in this order:
  • CLI parameter
  • VM parameter
  • Cloud profile setting
salt.cloud.clouds.aliyun.get_securitygroup(vm_)

Return the security group

salt.cloud.clouds.aliyun.get_size(vm_)

Return the VM's size. Used by create_node().

salt.cloud.clouds.aliyun.list_availability_zones(call=None)

List all availability zones in the current region

salt.cloud.clouds.aliyun.list_monitor_data(kwargs=None, call=None)

Get monitor data of the instance. If instance name is missing, will show all the instance monitor data on the region.

CLI Examples:

salt-cloud -f list_monitor_data aliyun
salt-cloud -f list_monitor_data aliyun name=AY14051311071990225bd
salt.cloud.clouds.aliyun.list_nodes(call=None)

Return a list of the VMs that are on the provider

salt.cloud.clouds.aliyun.list_nodes_full(call=None)

Return a list of the VMs that are on the provider

salt.cloud.clouds.aliyun.list_nodes_min(call=None)

Return a list of the VMs that are on the provider. Only a list of VM names, and their state, is returned. This is the minimum amount of information needed to check for existing VMs.

salt.cloud.clouds.aliyun.list_nodes_select(call=None)

Return a list of the VMs that are on the provider, with select fields

salt.cloud.clouds.aliyun.list_securitygroup(call=None)

Return a list of security group

salt.cloud.clouds.aliyun.query(params=None)

Make a web call to aliyun ECS REST API

salt.cloud.clouds.aliyun.reboot(name, call=None)

Reboot a node

CLI Examples:

salt-cloud -a reboot myinstance
salt.cloud.clouds.aliyun.script(vm_)

Return the script deployment object

salt.cloud.clouds.aliyun.show_disk(name, call=None)

Show the disk details of the instance

CLI Examples:

salt-cloud -a show_disk aliyun myinstance
salt.cloud.clouds.aliyun.show_image(kwargs, call=None)

Show the details from aliyun image

salt.cloud.clouds.aliyun.show_instance(name, call=None)

Show the details from aliyun instance

salt.cloud.clouds.aliyun.start(name, call=None)

Start a node

CLI Examples:

salt-cloud -a start myinstance
salt.cloud.clouds.aliyun.stop(name, force=False, call=None)

Stop a node

CLI Examples:

salt-cloud -a stop myinstance
salt-cloud -a stop myinstance force=True