Skip to content

Commit

Permalink
Update comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
dengqinsi committed Sep 29, 2015
1 parent 2a65624 commit 3063a57
Show file tree
Hide file tree
Showing 35 changed files with 43 additions and 62 deletions.
2 changes: 1 addition & 1 deletion fog-aliyun.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require 'fog/aliyun/version'
Gem::Specification.new do |spec|
spec.name = "fog-aliyun"
spec.version = Fog::Aliyun::VERSION
spec.authors = ["dengqinsi/lijianxun/hanyuting"]
spec.authors = ["Qinsi Deng, Jianxun Li, Jane Han"]
spec.email = ["dengqs@dtdream.com"]

spec.summary = %q{Fog provider for Aliyun Web Services.}
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/allocate_eip_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ def allocate_address(pool = nil)
response
end
end # mock
end # openstack
end # aliyun
end #compute
end
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ def allocate_address(pool = nil)
response
end
end # mock
end # openstack
end # aliyun
end #compute
end
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/associate_eip_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ def allocate_address(pool = nil)
response
end
end # mock
end # openstack
end # Aliyun
end #compute
end
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/create_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ def create_security_group(name, description)
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end # fog
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/create_security_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ def create_security_group(name, description)
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end # fog
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def create_security_group_ip_rule(securitygroup_id,sourceCidrIp, nicType, option
pathUrl += '&NicType='
pathUrl += nicType

#端口范围可选,缺省为所有端口
portRange = option[:portRange]
unless portRange
portRange = '-1/-1'
Expand All @@ -33,7 +32,6 @@ def create_security_group_ip_rule(securitygroup_id,sourceCidrIp, nicType, option
pathUrl += '&PortRange='
pathUrl += URI.encode(portRange,'/[^!*\'()\;?:@#&%=+$,{}[]<>`" ')

#协议类型(tcp/udp等)可选,缺省为所有协议
protocol = option[:protocol]
unless protocol
protocol = 'all'
Expand Down Expand Up @@ -83,6 +81,6 @@ def create_security_group_rule(parent_group_id, ip_protocol, from_port, to_port,
response
end
end # mock
end # openstack
end # aliyun
end # compute
end # fog
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ def create_security_group_sg_rule(securitygroup_id, source_securyitgroup_id, opt
pathUrl += '&SourceGroupId='
pathUrl += source_securyitgroup_id

nicType = 'intranet' #安全组互相授权固定是内网授权模式
nicType = 'intranet'
parameters["NicType"] = nicType
pathUrl += '&NicType='
pathUrl += nicType

#端口范围可选,缺省为所有端口
portRange = option[:portRange]
unless portRange
portRange = '-1/-1'
Expand All @@ -33,7 +32,6 @@ def create_security_group_sg_rule(securitygroup_id, source_securyitgroup_id, opt
pathUrl += '&PortRange='
pathUrl += URI.encode(portRange,'/[^!*\'()\;?:@#&%=+$,{}[]<>`" ')

#协议类型(tcp/udp等)可选,缺省为所有协议
protocol = option[:protocol]
unless protocol
protocol = 'all'
Expand Down Expand Up @@ -83,6 +81,6 @@ def create_security_group_rule(parent_group_id, ip_protocol, from_port, to_port,
response
end
end # mock
end # openstack
end # aliyun
end # compute
end # fog
8 changes: 2 additions & 6 deletions lib/fog/aliyun/requests/compute/create_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,18 @@ def create_server(imageId, securityGroupId, instanceType, options = {})
_parameters['ImageId'] = imageId
_pathURL += '&ImageId='+imageId

# instanceType改为直接传入id,由外部调用者通过get接口获取type
# instanceType = get_instance_type(cpuNum, memory)
# puts "instanceType:"+instanceType
_parameters['InstanceType'] = instanceType
_pathURL += '&InstanceType='+instanceType

_parameters['SecurityGroupId'] = securityGroupId
_pathURL += '&SecurityGroupId='+securityGroupId

#可选参数
_ZoneId = options[:ZoneId]
if _ZoneId
_parameters['ZoneId']=_ZoneId
_pathURL += '&ZoneId='+_ZoneId
end

_InstanceName = options[:InstanceName]
if _InstanceName
_parameters['InstanceName']=_InstanceName
Expand Down Expand Up @@ -72,7 +68,7 @@ def create_server(imageId, securityGroupId, instanceType, options = {})
_pathURL += '&PrivateIpAddress='+_PrivateIpAddress
end
else
#VPC方式不需要设置带宽属性,非VPC方式才能设置入出带宽

_InternetMaxBandwidthIn = options[:InternetMaxBandwidthIn]
if _InternetMaxBandwidthIn
_parameters['InternetMaxBandwidthIn']=_InternetMaxBandwidthIn
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/create_vpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ def create_security_group(name, description)
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end # fog
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/create_vswitch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ def create_security_group(name, description)
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end # fog
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/delete_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ def create_security_group(name, description)
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end # fog
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/delete_security_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ def delete_security_group(security_group_id)
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end #fog
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def delete_security_group_ip_rule(securyitgroup_id,sourceCidrIp, nicType, option
pathUrl += '&NicType='
pathUrl += nicType

#端口范围可选,缺省为所有端口
portRange = option[:portRange]
unless portRange
portRange = '-1/-1'
Expand All @@ -32,7 +31,6 @@ def delete_security_group_ip_rule(securyitgroup_id,sourceCidrIp, nicType, option
pathUrl += '&PortRange='
pathUrl += URI.encode(portRange,'/[^!*\'()\;?:@#&%=+$,{}[]<>`" ')

#协议类型(tcp/udp等)可选,缺省为所有协议
protocol = option[:protocol]
unless protocol
protocol = 'all'
Expand Down Expand Up @@ -82,6 +80,6 @@ def create_security_group_rule(parent_group_id, ip_protocol, from_port, to_port,
response
end
end # mock
end # openstack
end # aliyun
end # compute
end # fog
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ def delete_security_group_sg_rule(securitygroup_id, source_securyitgroup_id, opt
pathUrl += '&SourceGroupId='
pathUrl += source_securyitgroup_id

nicType = 'intranet' #安全组互相授权固定是内网授权模式
nicType = 'intranet'
parameters["NicType"] = nicType
pathUrl += '&NicType='
pathUrl += nicType

#端口范围可选,缺省为所有端口
portRange = option[:portRange]
unless portRange
portRange = '-1/-1'
Expand All @@ -33,7 +32,6 @@ def delete_security_group_sg_rule(securitygroup_id, source_securyitgroup_id, opt
pathUrl += '&PortRange='
pathUrl += URI.encode(portRange,'/[^!*\'()\;?:@#&%=+$,{}[]<>`" ')

#协议类型(tcp/udp等)可选,缺省为所有协议
protocol = option[:protocol]
unless protocol
protocol = 'all'
Expand Down Expand Up @@ -83,6 +81,6 @@ def create_security_group_rule(parent_group_id, ip_protocol, from_port, to_port,
response
end
end # mock
end # openstack
end # aliyun
end # compute
end # fog
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/delete_vpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ def delete_security_group(security_group_id)
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end #fog
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/delete_vswitch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ def delete_security_group(security_group_id)
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end #fog
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/list_disks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def list_disks(options={})

pageSize = options[:pageSize]
unless pageSize
pageSize = '50' #ȱʡÿҳÏÔʾ50Ìõ
pageSize = '50'
end
parameters["PageSize"] = pageSize
pathUrl += '&PageSize='
Expand Down
5 changes: 2 additions & 3 deletions lib/fog/aliyun/requests/compute/list_eip_addresses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def list_eip_addresses(options={})
_parameters = defalutParameters(_action, _sigNonce, _time)
_pathURL = defaultAliyunUri(_action, _sigNonce, _time)

#可选参数
_Status = options[:aliyun_Status]
if _Status
_parameters['Status']=_Status
Expand All @@ -39,7 +38,7 @@ def list_eip_addresses(options={})

_PageSize = options[:pageSize]
unless _PageSize
_PageSize = '50' #缺省每页显示50条
_PageSize = '50'
end
_parameters['PageSize']=_PageSize
_pathURL += '&PageSize='+_PageSize
Expand Down Expand Up @@ -77,6 +76,6 @@ def allocate_address(pool = nil)
response
end
end # mock
end # openstack
end # Aliyun
end #compute
end
3 changes: 1 addition & 2 deletions lib/fog/aliyun/requests/compute/list_images.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def list_images(options={})

pageSize = options[:pageSize]
unless pageSize
pageSize = '50' #ȱʡÿҳÏÔʾ50Ìõ
pageSize = '50'
end
parameters["PageSize"] = pageSize
pathUrl += '&PageSize='
Expand All @@ -48,7 +48,6 @@ def list_images(options={})
pathUrl += snapshotId
end

#'system'-alyun, 'self'-userdef, 'others'-, 'marketplace'-imagemarket
ownerAlias = options[:ownerAlias]
if ownerAlias
parameters["ImageOwnerAlias"] = ownerAlias
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ def get_security_group(security_group_id)
response
end
end # mock
end # openstack
end # aliyun
end # compute
end # fog
4 changes: 2 additions & 2 deletions lib/fog/aliyun/requests/compute/list_security_groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def list_security_groups(options={})

pageSize = options[:pageSize]
unless pageSize
pageSize = '50' #ȱʡÿҳÏÔʾ50Ìõ
pageSize = '50'
end
parameters["PageSize"] = pageSize
pathUrl += '&PageSize='
Expand Down Expand Up @@ -76,6 +76,6 @@ def list_security_groups(server_id = nil)
)
end
end # mock
end # openstack
end # aliyun
end # compute
end # fog
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/list_servers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def list_servers(options={})
end

unless _PageSize
_PageSize = '50' #ȱʡÿҳÏÔʾ50Ìõ
_PageSize = '50'
end
_parameters['PageSize']=_PageSize
_pathURL += '&PageSize='+_PageSize
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/list_snapshots.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def list_snapshoots(options={})
end

unless pageSize
pageSize = '50' #缺省每页显示50条
pageSize = '50'
end
parameters["PageSize"] = pageSize
pathUrl += '&PageSize='
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aliyun/requests/compute/list_vpcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def list_vpcs(options={})
end

unless pageSize
pageSize = '50' #ȱʡÿҳÏÔʾ50Ìõ
pageSize = '50'
end
parameters["PageSize"] = pageSize
pathUrl += '&PageSize='
Expand Down
6 changes: 1 addition & 5 deletions lib/fog/aliyun/requests/compute/list_vswitchs.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@




module Fog
module Compute
class Aliyun
Expand Down Expand Up @@ -35,7 +31,7 @@ def list_vswitchs(vpcid, options={})
end

unless pageSize
pageSize = '50' #ȱʡÿҳÏÔʾ50Ìõ
pageSize = '50'
end
parameters["PageSize"] = pageSize
pathUrl += '&PageSize='
Expand Down
4 changes: 2 additions & 2 deletions lib/fog/aliyun/requests/compute/modify_vpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Fog
module Compute
class Aliyun
class Real
# {Aliyun API Reference}[https://docs.aliyun.com/?spm=5176.100054.3.1.DGkmH7#/pub/ecs/open-api/vpc&modifyvpcattribute]
# {Aliyun API Reference}[https://docs.aliyun.com/?spm=5176.100054.3.1.DGkmH7#/pub/ecs/open-api/vpc&modifyvpcattribute]
def modify_vpc(vpcId,options={})

action = 'ModifyVpcAttribute'
Expand Down Expand Up @@ -68,6 +68,6 @@ def modify_vpc(vpcId, options={})
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end # fog
4 changes: 2 additions & 2 deletions lib/fog/aliyun/requests/compute/modify_vswitch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Fog
module Compute
class Aliyun
class Real
# {Aliyun API Reference}[https://docs.aliyun.com/?spm=5176.100054.3.1.DGkmH7#/pub/ecs/open-api/vswitch&modifyvswitchattribute]
# {Aliyun API Reference}[https://docs.aliyun.com/?spm=5176.100054.3.1.DGkmH7#/pub/ecs/open-api/vswitch&modifyvswitchattribute]
def modify_vpc(vSwitchId,options={})

action = 'ModifyVSwitchAttribute'
Expand Down Expand Up @@ -68,6 +68,6 @@ def modify_vpc(vpcId, options={})
response
end
end # mock
end # openstack
end # Aliyun
end # compute
end # fog
Loading

0 comments on commit 3063a57

Please sign in to comment.