fog-aliyun 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +0 -27
- data/lib/fog/aliyun/compute.rb +4 -8
- data/lib/fog/aliyun/models/storage/file.rb +6 -5
- data/lib/fog/aliyun/models/storage/files.rb +1 -1
- data/lib/fog/aliyun/requests/compute/create_server.rb +12 -8
- data/lib/fog/aliyun/requests/compute/join_security_group.rb +0 -8
- data/lib/fog/aliyun/requests/compute/leave_security_group.rb +0 -8
- data/lib/fog/aliyun/requests/compute/list_server_types.rb +9 -32
- data/lib/fog/aliyun/requests/compute/reboot_server.rb +0 -8
- data/lib/fog/aliyun/requests/compute/start_server.rb +5 -11
- data/lib/fog/aliyun/requests/compute/stop_server.rb +5 -11
- data/lib/fog/aliyun/requests/storage/copy_object.rb +0 -4
- data/lib/fog/aliyun/requests/storage/delete_bucket.rb +0 -4
- data/lib/fog/aliyun/requests/storage/delete_container.rb +0 -3
- data/lib/fog/aliyun/requests/storage/delete_object.rb +0 -4
- data/lib/fog/aliyun/requests/storage/get_bucket.rb +8 -11
- data/lib/fog/aliyun/requests/storage/get_container.rb +1 -6
- data/lib/fog/aliyun/requests/storage/get_containers.rb +1 -6
- data/lib/fog/aliyun/requests/storage/get_object.rb +0 -4
- data/lib/fog/aliyun/requests/storage/get_object_http_url.rb +5 -9
- data/lib/fog/aliyun/requests/storage/get_object_https_url.rb +5 -9
- data/lib/fog/aliyun/requests/storage/head_object.rb +0 -4
- data/lib/fog/aliyun/requests/storage/list_buckets.rb +1 -5
- data/lib/fog/aliyun/requests/storage/list_objects.rb +3 -9
- data/lib/fog/aliyun/requests/storage/put_bucket.rb +1 -5
- data/lib/fog/aliyun/requests/storage/put_container.rb +0 -4
- data/lib/fog/aliyun/requests/storage/put_object.rb +7 -12
- data/lib/fog/aliyun/storage.rb +1 -16
- data/lib/fog/aliyun/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f08037e2cb10948b237c66efcb1a9f3a125512c54fc2c62c9ca24dfb315bd214
|
4
|
+
data.tar.gz: d016945f6e23fdcdd331a4344253af808611971f29d8fc7a9cfe989b92823f14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 042efe491c541db521d0612b2e3db782b4e32d70a9df255661f65b0ea3bfc4e775ee981dc75c524c1c0dbcc5ae043fe29d3d91df0620fe599e1b8effd5177f30
|
7
|
+
data.tar.gz: 67287cf23649648869c2161cc3702c244c1cff0788c6162ea179e37d798a64ae6124fc2294846744b5d6f1ed1420f1cd1107a521d351c9fcf1c32f0fa0e5cbba
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -6,25 +6,6 @@
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count: 1
|
10
|
-
# Cop supports --auto-correct.
|
11
|
-
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
|
12
|
-
# SupportedStylesAlignWith: start_of_line, def
|
13
|
-
Layout/DefEndAlignment:
|
14
|
-
Exclude:
|
15
|
-
- 'lib/fog/aliyun/requests/storage/put_object.rb'
|
16
|
-
|
17
|
-
# Offense count: 5
|
18
|
-
# Cop supports --auto-correct.
|
19
|
-
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
|
20
|
-
# SupportedStylesAlignWith: keyword, variable, start_of_line
|
21
|
-
Layout/EndAlignment:
|
22
|
-
Exclude:
|
23
|
-
- 'lib/fog/aliyun/compute.rb'
|
24
|
-
- 'lib/fog/aliyun/models/storage/file.rb'
|
25
|
-
- 'lib/fog/aliyun/requests/compute/create_server.rb'
|
26
|
-
- 'lib/fog/aliyun/storage.rb'
|
27
|
-
|
28
9
|
# Offense count: 4
|
29
10
|
# Configuration parameters: AllowSafeAssignment.
|
30
11
|
Lint/AssignmentInCondition:
|
@@ -167,11 +148,3 @@ Style/MultipleComparison:
|
|
167
148
|
Exclude:
|
168
149
|
- 'lib/fog/aliyun/requests/storage/get_object_http_url.rb'
|
169
150
|
- 'lib/fog/aliyun/requests/storage/get_object_https_url.rb'
|
170
|
-
|
171
|
-
# Offense count: 1
|
172
|
-
# Cop supports --auto-correct.
|
173
|
-
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
|
174
|
-
# SupportedStyles: slashes, percent_r, mixed
|
175
|
-
Style/RegexpLiteral:
|
176
|
-
Exclude:
|
177
|
-
- 'lib/fog/aliyun/models/storage/files.rb'
|
data/lib/fog/aliyun/compute.rb
CHANGED
@@ -313,12 +313,10 @@ module Fog
|
|
313
313
|
Fog::Compute::Aliyun::NotFound.slurp(error)
|
314
314
|
else
|
315
315
|
error
|
316
|
-
|
316
|
+
end
|
317
317
|
end
|
318
318
|
|
319
|
-
if !response.body.empty? && response.get_header('Content-Type') == 'application/json'
|
320
|
-
response.body = Fog::JSON.decode(response.body)
|
321
|
-
end
|
319
|
+
response.body = Fog::JSON.decode(response.body) if !response.body.empty? && response.get_header('Content-Type') == 'application/json'
|
322
320
|
|
323
321
|
response
|
324
322
|
end
|
@@ -338,12 +336,10 @@ module Fog
|
|
338
336
|
Fog::Compute::Aliyun::NotFound.slurp(error)
|
339
337
|
else
|
340
338
|
error
|
341
|
-
|
339
|
+
end
|
342
340
|
end
|
343
341
|
|
344
|
-
if !response.body.empty? && response.get_header('Content-Type') == 'application/json'
|
345
|
-
response.body = Fog::JSON.decode(response.body)
|
346
|
-
end
|
342
|
+
response.body = Fog::JSON.decode(response.body) if !response.body.empty? && response.get_header('Content-Type') == 'application/json'
|
347
343
|
|
348
344
|
response
|
349
345
|
end
|
@@ -19,11 +19,12 @@ module Fog
|
|
19
19
|
attribute :object_type, aliases: 'x-oss-object-type'
|
20
20
|
|
21
21
|
def body
|
22
|
-
attributes[:body] ||=
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
attributes[:body] ||=
|
23
|
+
if last_modified
|
24
|
+
collection.get(identity).body
|
25
|
+
else
|
26
|
+
''
|
27
|
+
end
|
27
28
|
end
|
28
29
|
|
29
30
|
def body=(new_body)
|
@@ -105,14 +105,18 @@ module Fog
|
|
105
105
|
u.name == @openstack_username
|
106
106
|
end
|
107
107
|
|
108
|
-
user_id =
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
108
|
+
user_id =
|
109
|
+
if user
|
110
|
+
user.id
|
111
|
+
else
|
112
|
+
response =
|
113
|
+
identity.create_user(
|
114
|
+
@openstack_username,
|
115
|
+
'password',
|
116
|
+
"#{@openstack_username}@example.com"
|
117
|
+
)
|
118
|
+
response.body['user']['id']
|
119
|
+
end
|
116
120
|
|
117
121
|
mock_data = {
|
118
122
|
'addresses' => { 'Private' => [{ 'addr' => Fog::Mock.random_ip }] },
|
@@ -21,14 +21,7 @@ module Fog
|
|
21
21
|
method: 'GET',
|
22
22
|
path: _pathURL
|
23
23
|
)
|
24
|
-
|
25
|
-
# _InstanceType = Hash.new
|
26
|
-
# _InstanceTypeList = Fog::JSON.decode(response.body)["InstanceTypes"]["InstanceType"]
|
27
|
-
# _InstanceTypeList.each do |instanceType|
|
28
|
-
# _InstanceType[[instanceType["CpuCoreCount"], instanceType["MemorySize"]]] = instanceType["InstanceTypeId"]
|
29
|
-
# end
|
30
|
-
# _InstanceType
|
31
|
-
end list_server_types
|
24
|
+
end
|
32
25
|
|
33
26
|
def get_instance_type(cpuCount, memorySize)
|
34
27
|
_action = 'DescribeInstanceTypes'
|
@@ -49,31 +42,15 @@ module Fog
|
|
49
42
|
|
50
43
|
_InstanceTypeId = nil
|
51
44
|
_InstanceTypeList = Fog::JSON.decode(response.body)['InstanceTypes']['InstanceType']
|
52
|
-
_InstanceTypeList.each do |
|
53
|
-
next unless (
|
54
|
-
_InstanceTypeId =
|
45
|
+
_InstanceTypeList.each do |instance_type|
|
46
|
+
next unless (instance_type['CpuCoreCount'] == cpuCount) && (instance_type['MemorySize'] == memorySize)
|
47
|
+
_InstanceTypeId = instance_type['InstanceTypeId']
|
55
48
|
puts '_instanceTypeId: ' + _InstanceTypeId
|
56
49
|
break
|
57
|
-
|
58
|
-
end each
|
50
|
+
end
|
59
51
|
_InstanceTypeId
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
# def list_servers(options = {})
|
65
|
-
# response = Excon::Response.new
|
66
|
-
# data = list_servers_detail.body['servers']
|
67
|
-
# servers = []
|
68
|
-
# for server in data
|
69
|
-
# servers << server.reject { |key, value| !['id', 'name', 'links'].include?(key) }
|
70
|
-
# end
|
71
|
-
# response.status = [200, 203][rand(1)]
|
72
|
-
# response.body = { 'servers' => servers }
|
73
|
-
# response
|
74
|
-
# end
|
75
|
-
# end
|
76
|
-
end class Aliyun
|
77
|
-
end module Compute
|
78
|
-
# end module Fog
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
79
56
|
end
|
@@ -30,14 +30,8 @@ module Fog
|
|
30
30
|
method: 'GET',
|
31
31
|
path: _pathURL
|
32
32
|
)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
true
|
39
|
-
end start_server
|
40
|
-
end Mock
|
41
|
-
end aliyun
|
42
|
-
end Compute
|
43
|
-
end Fog
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -30,14 +30,8 @@ module Fog
|
|
30
30
|
method: 'GET',
|
31
31
|
path: _pathURL
|
32
32
|
)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
true
|
39
|
-
end stop_server
|
40
|
-
end Mock
|
41
|
-
end aliyun
|
42
|
-
end Compute
|
43
|
-
end Fog
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -16,7 +16,7 @@ module Fog
|
|
16
16
|
endpoint: endpoint
|
17
17
|
)
|
18
18
|
xml = ret.data[:body]
|
19
|
-
|
19
|
+
XmlSimple.xml_in(xml)
|
20
20
|
end
|
21
21
|
|
22
22
|
def get_bucket_location(bucket)
|
@@ -29,7 +29,7 @@ module Fog
|
|
29
29
|
bucket: bucket,
|
30
30
|
resource: resource
|
31
31
|
)
|
32
|
-
|
32
|
+
XmlSimple.xml_in(ret.data[:body])
|
33
33
|
end
|
34
34
|
|
35
35
|
def get_bucket_acl(bucket)
|
@@ -45,7 +45,7 @@ module Fog
|
|
45
45
|
resource: resource,
|
46
46
|
endpoint: endpoint
|
47
47
|
)
|
48
|
-
|
48
|
+
XmlSimple.xml_in(ret.data[:body])['AccessControlList'][0]['Grant'][0]
|
49
49
|
end
|
50
50
|
|
51
51
|
def get_bucket_CORSRules(bucket)
|
@@ -61,7 +61,7 @@ module Fog
|
|
61
61
|
resource: resource,
|
62
62
|
endpoint: endpoint
|
63
63
|
)
|
64
|
-
|
64
|
+
XmlSimple.xml_in(ret.data[:body])['CORSRule'][0] if ret.data[:status] != 404
|
65
65
|
end
|
66
66
|
|
67
67
|
def get_bucket_lifecycle(bucket)
|
@@ -77,7 +77,7 @@ module Fog
|
|
77
77
|
resource: resource,
|
78
78
|
endpoint: endpoint
|
79
79
|
)
|
80
|
-
|
80
|
+
XmlSimple.xml_in(ret.data[:body])['Rule'][0] if ret.data[:status] != 404
|
81
81
|
end
|
82
82
|
|
83
83
|
def get_bucket_logging(bucket)
|
@@ -93,7 +93,7 @@ module Fog
|
|
93
93
|
resource: resource,
|
94
94
|
endpoint: endpoint
|
95
95
|
)
|
96
|
-
|
96
|
+
XmlSimple.xml_in(ret.data[:body])['LoggingEnabled'][0]['TargetPrefix']
|
97
97
|
end
|
98
98
|
|
99
99
|
def get_bucket_referer(bucket)
|
@@ -109,7 +109,7 @@ module Fog
|
|
109
109
|
resource: resource,
|
110
110
|
endpoint: endpoint
|
111
111
|
)
|
112
|
-
|
112
|
+
XmlSimple.xml_in(ret.data[:body])
|
113
113
|
end
|
114
114
|
|
115
115
|
def get_bucket_website(bucket)
|
@@ -125,12 +125,9 @@ module Fog
|
|
125
125
|
resource: resource,
|
126
126
|
endpoint: endpoint
|
127
127
|
)
|
128
|
-
|
128
|
+
XmlSimple.xml_in(ret.data[:body]) if ret.data[:status] != 404
|
129
129
|
end
|
130
130
|
end
|
131
|
-
class Mock
|
132
|
-
def get_bucket(bucket); end
|
133
|
-
end
|
134
131
|
end
|
135
132
|
end
|
136
133
|
end
|
@@ -39,7 +39,6 @@ module Fog
|
|
39
39
|
end
|
40
40
|
|
41
41
|
location = get_bucket_location(bucket)
|
42
|
-
endpoint = 'http://' + location + '.aliyuncs.com'
|
43
42
|
resource = bucket + '/'
|
44
43
|
ret = request(
|
45
44
|
expects: [200, 203, 400],
|
@@ -49,13 +48,9 @@ module Fog
|
|
49
48
|
bucket: bucket
|
50
49
|
)
|
51
50
|
xml = ret.data[:body]
|
52
|
-
|
51
|
+
XmlSimple.xml_in(xml)['CommonPrefixes']
|
53
52
|
end
|
54
53
|
end
|
55
|
-
|
56
|
-
class Mock
|
57
|
-
def get_container(container, options = {}); end
|
58
|
-
end
|
59
54
|
end
|
60
55
|
end
|
61
56
|
end
|
@@ -43,7 +43,6 @@ module Fog
|
|
43
43
|
end
|
44
44
|
|
45
45
|
location = get_bucket_location(bucket)
|
46
|
-
endpoint = 'http://' + location + '.aliyuncs.com'
|
47
46
|
resource = bucket + '/'
|
48
47
|
ret = request(
|
49
48
|
expects: [200, 203, 400],
|
@@ -53,13 +52,9 @@ module Fog
|
|
53
52
|
bucket: bucket
|
54
53
|
)
|
55
54
|
xml = ret.data[:body]
|
56
|
-
|
55
|
+
XmlSimple.xml_in(xml)['CommonPrefixes']
|
57
56
|
end
|
58
57
|
end
|
59
|
-
|
60
|
-
class Mock
|
61
|
-
def get_containers(options = {}); end
|
62
|
-
end
|
63
58
|
end
|
64
59
|
end
|
65
60
|
end
|
@@ -25,20 +25,16 @@ module Fog
|
|
25
25
|
expires_time = (Time.now.to_i + expires).to_s
|
26
26
|
resource = bucket + '/' + object
|
27
27
|
signature = sign('GET', expires_time, nil, resource)
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
'http://' + bucket + '.' + location + '.aliyuncs.com/' + object +
|
29
|
+
'?OSSAccessKeyId=' + @aliyun_accesskey_id + '&Expires=' + expires_time +
|
30
|
+
'&Signature=' + URI.encode(signature, '/[^!*\'()\;?:@#&%=+$,{}[]<>`" ')
|
31
31
|
elsif acl == 'public-read' || acl == 'public-read-write'
|
32
|
-
|
32
|
+
'http://' + bucket + '.' + location + '.aliyuncs.com/' + object
|
33
33
|
else
|
34
|
-
|
34
|
+
'acl is wrong with value:' + acl
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
39
|
-
class Mock
|
40
|
-
def get_object_http_url_public(object, expires, options = {}); end
|
41
|
-
end
|
42
38
|
end
|
43
39
|
end
|
44
40
|
end
|
@@ -25,20 +25,16 @@ module Fog
|
|
25
25
|
expires_time = (Time.now.to_i + expires).to_s
|
26
26
|
resource = bucket + '/' + object
|
27
27
|
signature = sign('GET', expires_time, nil, resource)
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
'https://' + bucket + '.' + location + '.aliyuncs.com/' + object +
|
29
|
+
'?OSSAccessKeyId=' + @aliyun_accesskey_id + '&Expires=' + expires_time +
|
30
|
+
'&Signature=' + URI.encode(signature, '/[^!*\'()\;?:@#&%=+$,{}[]<>`" ')
|
31
31
|
elsif acl == 'public-read' || acl == 'public-read-write'
|
32
|
-
|
32
|
+
'https://' + bucket + '.' + location + '.aliyuncs.com/' + object
|
33
33
|
else
|
34
|
-
|
34
|
+
'acl is wrong with value:' + acl
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
39
|
-
class Mock
|
40
|
-
def get_object_https_url_public(object, expires, options = {}); end
|
41
|
-
end
|
42
38
|
end
|
43
39
|
end
|
44
40
|
end
|
@@ -31,8 +31,6 @@ module Fog
|
|
31
31
|
path += '?delimiter=' + delimiter
|
32
32
|
end
|
33
33
|
|
34
|
-
location = get_bucket_location(bucket)
|
35
|
-
endpoint = 'http://' + location + '.aliyuncs.com'
|
36
34
|
resource = bucket + '/'
|
37
35
|
ret = request(
|
38
36
|
expects: [200, 203, 400],
|
@@ -42,7 +40,7 @@ module Fog
|
|
42
40
|
bucket: bucket
|
43
41
|
)
|
44
42
|
xml = ret.data[:body]
|
45
|
-
|
43
|
+
XmlSimple.xml_in(xml)
|
46
44
|
end
|
47
45
|
|
48
46
|
def list_multipart_uploads(bucket, endpoint, _options = {})
|
@@ -61,7 +59,7 @@ module Fog
|
|
61
59
|
resource: resource,
|
62
60
|
endpoint: endpoint
|
63
61
|
)
|
64
|
-
|
62
|
+
XmlSimple.xml_in(ret.data[:body])['Upload']
|
65
63
|
end
|
66
64
|
|
67
65
|
def list_parts(bucket, object, endpoint, uploadid, _options = {})
|
@@ -80,13 +78,9 @@ module Fog
|
|
80
78
|
resource: resource,
|
81
79
|
endpoint: endpoint
|
82
80
|
)
|
83
|
-
|
81
|
+
XmlSimple.xml_in(ret.data[:body])['Part']
|
84
82
|
end
|
85
83
|
end
|
86
|
-
|
87
|
-
class Mock
|
88
|
-
def list_objects(options = {}); end
|
89
|
-
end
|
90
84
|
end
|
91
85
|
end
|
92
86
|
end
|
@@ -6,7 +6,7 @@ module Fog
|
|
6
6
|
class Real
|
7
7
|
def put_bucket(bucketName)
|
8
8
|
resource = bucketName + '/'
|
9
|
-
|
9
|
+
request(
|
10
10
|
expects: [200, 203],
|
11
11
|
method: 'PUT',
|
12
12
|
resource: resource,
|
@@ -14,10 +14,6 @@ module Fog
|
|
14
14
|
)
|
15
15
|
end
|
16
16
|
end
|
17
|
-
|
18
|
-
class Mock
|
19
|
-
def put_bucket(bucketName); end
|
20
|
-
end
|
21
17
|
end
|
22
18
|
end
|
23
19
|
end
|
@@ -22,7 +22,7 @@ module Fog
|
|
22
22
|
body = file.read
|
23
23
|
|
24
24
|
resource = bucket + '/' + object
|
25
|
-
|
25
|
+
request(
|
26
26
|
expects: [200, 203],
|
27
27
|
method: 'PUT',
|
28
28
|
path: object,
|
@@ -40,7 +40,7 @@ module Fog
|
|
40
40
|
endpoint = 'http://' + location + '.aliyuncs.com'
|
41
41
|
|
42
42
|
resource = bucket + '/' + object
|
43
|
-
|
43
|
+
request(
|
44
44
|
expects: [200, 203],
|
45
45
|
method: 'PUT',
|
46
46
|
path: object,
|
@@ -49,7 +49,7 @@ module Fog
|
|
49
49
|
body: body,
|
50
50
|
endpoint: endpoint
|
51
51
|
)
|
52
|
-
|
52
|
+
end
|
53
53
|
|
54
54
|
def put_folder(bucket, folder, endpoint)
|
55
55
|
if endpoint.nil?
|
@@ -58,7 +58,7 @@ module Fog
|
|
58
58
|
end
|
59
59
|
path = folder + '/'
|
60
60
|
resource = bucket + '/' + folder + '/'
|
61
|
-
|
61
|
+
request(
|
62
62
|
expects: [200, 203],
|
63
63
|
method: 'PUT',
|
64
64
|
path: path,
|
@@ -76,7 +76,6 @@ module Fog
|
|
76
76
|
uploads = list_multipart_uploads(bucket, endpoint)
|
77
77
|
upload = (uploads&.find { |tmpupload| tmpupload['Key'][0] == object })
|
78
78
|
|
79
|
-
parts = nil
|
80
79
|
uploadedSize = 0
|
81
80
|
start_partNumber = 1
|
82
81
|
if !upload.nil?
|
@@ -127,7 +126,7 @@ module Fog
|
|
127
126
|
resource: resource,
|
128
127
|
endpoint: endpoint
|
129
128
|
)
|
130
|
-
|
129
|
+
XmlSimple.xml_in(ret.data[:body])['UploadId'][0]
|
131
130
|
end
|
132
131
|
|
133
132
|
def upload_part(bucket, object, endpoint, partNumber, uploadId, body)
|
@@ -137,7 +136,7 @@ module Fog
|
|
137
136
|
end
|
138
137
|
path = object + '?partNumber=' + partNumber + '&uploadId=' + uploadId
|
139
138
|
resource = bucket + '/' + path
|
140
|
-
|
139
|
+
request(
|
141
140
|
expects: [200, 203],
|
142
141
|
method: 'PUT',
|
143
142
|
path: path,
|
@@ -164,7 +163,7 @@ module Fog
|
|
164
163
|
|
165
164
|
path = object + '?uploadId=' + uploadId
|
166
165
|
resource = bucket + '/' + path
|
167
|
-
|
166
|
+
request(
|
168
167
|
expects: 200,
|
169
168
|
method: 'POST',
|
170
169
|
path: path,
|
@@ -175,10 +174,6 @@ module Fog
|
|
175
174
|
)
|
176
175
|
end
|
177
176
|
end
|
178
|
-
|
179
|
-
class Mock
|
180
|
-
def put_object(object, file = nil, options = {}); end
|
181
|
-
end
|
182
177
|
end
|
183
178
|
end
|
184
179
|
end
|
data/lib/fog/aliyun/storage.rb
CHANGED
@@ -160,7 +160,7 @@ module Fog
|
|
160
160
|
Fog::Storage::Aliyun::NotFound.slurp(error)
|
161
161
|
else
|
162
162
|
error
|
163
|
-
|
163
|
+
end
|
164
164
|
end
|
165
165
|
|
166
166
|
response
|
@@ -199,22 +199,7 @@ module Fog
|
|
199
199
|
@aliyun_accesskey_secret = options[:aliyun_accesskey_secret]
|
200
200
|
@aliyun_oss_bucket = options[:aliyun_oss_bucket]
|
201
201
|
|
202
|
-
# missing_credentials = Array.new
|
203
|
-
# missing_credentials << :aliyun_oss_endpoint unless @aliyun_oss_endpoint
|
204
|
-
# missing_credentials << :aliyun_region_id unless @aliyun_region_id
|
205
|
-
# missing_credentials << :aliyun_accesskey_id unless @aliyun_accesskey_id
|
206
|
-
# missing_credentials << :aliyun_accesskey_secret unless @aliyun_accesskey_secret
|
207
|
-
# raise ArgumentError, "Missing required arguments: #{missing_credentials.join(', ')}" unless missing_credentials.empty?
|
208
|
-
|
209
202
|
@connection_options = options[:connection_options] || {}
|
210
|
-
|
211
|
-
# uri = URI.parse(@aliyun_oss_endpoint)
|
212
|
-
# @host = uri.host
|
213
|
-
# @path = uri.path
|
214
|
-
# @port = uri.port
|
215
|
-
# @scheme = uri.scheme
|
216
|
-
|
217
|
-
# @persistent = options[:persistent] || false
|
218
203
|
end
|
219
204
|
end
|
220
205
|
end
|
data/lib/fog/aliyun/version.rb
CHANGED