forked from TrueCloudLab/frostfs-testlib
[#354] Support of presigned url methods for S3
Signed-off-by: Yaroslava Lukoyanova <y.lukoyanova@yadro.com>
This commit is contained in:
parent
c4ab14fce8
commit
d38808a1f5
4 changed files with 34 additions and 1 deletions
|
@ -959,6 +959,15 @@ class AwsCliClient(S3ClientWrapper):
|
|||
|
||||
return json_output
|
||||
|
||||
@reporter.step("Create presign url for the object")
|
||||
def create_presign_url(self, method: str, bucket: str, key: str, expires_in: Optional[int] = 3600) -> str:
|
||||
# AWS CLI does not support method definition and world only in 'get_object' state by default
|
||||
cmd = f"aws {self.common_flags} s3 presign s3://{bucket}/{key} " f"--endpoint-url {self.s3gate_endpoint} --profile {self.profile}"
|
||||
if expires_in:
|
||||
cmd += f" --expires-in {expires_in}"
|
||||
response = self.local_shell.exec(cmd).stdout
|
||||
return response.strip()
|
||||
|
||||
# IAM METHODS #
|
||||
# Some methods don't have checks because AWS is silent in some cases (delete, attach, etc.)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue