1.想问一下师傅们,之前记得有一个平台好像集合了很多公有云,什么亚马逊云,百度云,阿里云,金山云啊这些,可以通过accesskey方式去登录服务器的OSS和服务器权限。有哪位师傅知道的。在这里先谢谢各位师傅了。
2.还有个问题,这个文章字数是多少,100字还是200字,总规则好像也没看到。

2.还有个问题,这个文章字数是多少,100字还是200字,总规则好像也没看到。


#!/usr/bin/env python
#coding=utf-8
import json, base64
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkecs.request.v20140526.CreateCommandRequest import CreateCommandRequest
from aliyunsdkecs.request.v20140526.InvokeCommandRequest import InvokeCommandRequest
ID = '123' # Access Id
KEY = '123' # Access Key
reGon = 'cn-shenzhen' # 地区
InstanceId = ["123"] # 实例ID
CmdBytes = b'''此处是命令不要删除下面的换行
'''# 要执行的命令
Cmd = base64.b64encode(CmdBytes).decode('utf-8')
CmdType = "RunShellScript"
# RunBatScript:创建一个在Windows实例中运行的 Bat 脚本。
# RunPowerShellScript:创建一个在Windows实例中运行的PowerShell脚本。
# RunShellScript:创建一个在Linux实例中运行的Shell脚本。
client = AcsClient(ID, KEY, reGon)
request = CreateCommandRequest()
request.set_accept_format('json')
request.set_Name("123123")
request.set_Type("RunShellScript")
request.set_CommandContent(Cmd)
response = client.do_action_with_exception(request)
print(str(response, encoding='utf-8'))
request2 = InvokeCommandRequest()
request2.set_accept_format('json')
request2.set_CommandId((json.loads(response))['CommandId'])
request2.set_InstanceIds(InstanceId)
response = client.do_action_with_exception(request2)
print(str(response, encoding='utf-8'))T00.ls | GMT+8, 2026-11-13 07:03
Powered by T00ls.com