Skip to content

Commit 4889f50

Browse files
Merge branch 'dev' into proj/multicluster-obj
2 parents 8d47be4 + 77e3a84 commit 4889f50

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

linode_api4/objects/object_storage.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ def access_modify(
9898
}
9999

100100
resp = self._client.post(
101-
"/object-storage/buckets/{}/{}/access".format(
102-
parse.quote(str(self.cluster)), parse.quote(str(self.id))
103-
),
101+
f"{self.api_endpoint}/access",
104102
data=drop_null_keys(params),
103+
model=self,
105104
)
106105

107106
if "errors" in resp:
@@ -140,10 +139,9 @@ def access_update(
140139
}
141140

142141
resp = self._client.put(
143-
"/object-storage/buckets/{}/{}/access".format(
144-
parse.quote(str(self.cluster)), parse.quote(str(self.id))
145-
),
142+
f"{self.api_endpoint}/access",
146143
data=drop_null_keys(params),
144+
model=self,
147145
)
148146

149147
if "errors" in resp:
@@ -165,9 +163,8 @@ def ssl_cert_delete(self):
165163
"""
166164

167165
resp = self._client.delete(
168-
"/object-storage/buckets/{}/{}/ssl".format(
169-
parse.quote(str(self.cluster)), parse.quote(str(self.id))
170-
)
166+
f"{self.api_endpoint}/ssl",
167+
model=self,
171168
)
172169

173170
if "error" in resp:
@@ -190,9 +187,8 @@ def ssl_cert(self):
190187
:rtype: MappedObject
191188
"""
192189
result = self._client.get(
193-
"/object-storage/buckets/{}/{}/ssl".format(
194-
parse.quote(str(self.cluster)), parse.quote(str(self.id))
195-
)
190+
f"{self.api_endpoint}/ssl",
191+
model=self,
196192
)
197193

198194
if not "ssl" in result:
@@ -233,10 +229,9 @@ def ssl_cert_upload(self, certificate, private_key):
233229
"private_key": private_key,
234230
}
235231
result = self._client.post(
236-
"/object-storage/buckets/{}/{}/ssl".format(
237-
parse.quote(str(self.cluster)), parse.quote(str(self.id))
238-
),
232+
f"{self.api_endpoint}/ssl",
239233
data=params,
234+
model=self,
240235
)
241236

242237
if not "ssl" in result:
@@ -300,10 +295,9 @@ def contents(
300295
"page_size": page_size,
301296
}
302297
result = self._client.get(
303-
"/object-storage/buckets/{}/{}/object-list".format(
304-
parse.quote(str(self.cluster)), parse.quote(str(self.id))
305-
),
298+
f"{self.api_endpoint}/object-list",
306299
data=drop_null_keys(params),
300+
model=self,
307301
)
308302

309303
if not "data" in result:

0 commit comments

Comments
 (0)