def get_service_info(self, region): if region == REGION_AP_SINGAPORE1: service_info = ServiceInfo("sms.byteplusapi.com", {'Accept': 'application/json'}, Credentials('', '', 'volcSMS', region), 5, 5) else: service_info = ServiceInfo("sms.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'volcSMS', region), 5, 5) return service_info
def get_service_info(region): service_info_map = { 'cn-north-1': ServiceInfo("cloud-vms.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'volc_secret_number', 'cn-north-1'), 10, 10), } service_info = service_info_map.get(region, None) if not service_info: raise Exception('Cant find the region, please check it carefully') return service_info
def get_service_info(region): service_info_map = { 'cn-north-1': ServiceInfo("vod.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'vod', 'cn-north-1'), 5, 5), 'ap-singapore-1': ServiceInfo("vod.ap-singapore-1.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'vod', 'ap-singapore-1'), 5, 5), 'us-east-1': ServiceInfo("vod.us-east-1.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'vod', 'us-east-1'), 5, 5), } service_info = service_info_map.get(region, None) if not service_info: raise Exception('Cant find the region, please check it carefully') return service_info
def get_service_info(region): service_info_map = { 'cn-north-1': ServiceInfo("vedit.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'edit', 'cn-north-1'), 5, 5, "https") } service_info = service_info_map.get(region, None) if not service_info: raise Exception('Cant find the region, please check it carefully') return service_info
def get_service_info(): service_info = ServiceInfo("open.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', 'game_protect', 'cn-north-1'), 5, 5) return service_info
from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service from volcengine.const.Const import * from volcengine.Policy import * import aiohttp from volcengine.auth.SignerV4 import SignerV4 LIVESAAS_SERVICE_NAME = "livesaas" LIVESAAS_API_VERSION = "2020-06-01" service_info_map = { REGION_CN_NORTH1: ServiceInfo("livesaas.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', LIVESAAS_SERVICE_NAME, REGION_CN_NORTH1), 5, 5, "https"), } api_info = { # 直播间管理类接口 "CreateActivityAPI": ApiInfo("POST", "/", { "Action": "CreateActivityAPI", "Version": LIVESAAS_API_VERSION }, {}, {}), "DeleteActivityAPI": ApiInfo("POST", "/", { "Action": "DeleteActivityAPI", "Version": LIVESAAS_API_VERSION }, {}, {}),
def get_service_info(): service_info = ServiceInfo("visual.volcengineapi.com", {}, Credentials('', '', 'cv', 'cn-north-1'), 10, 30) return service_info
from volcengine.ServiceInfo import ServiceInfo from volcengine.base.Service import Service from volcengine.const.Const import * from volcengine.util.Util import * from volcengine.Policy import * IMAGEX_SERVICE_NAME = "ImageX" IMAGEX_API_VERSION = "2018-08-01" ResourceServiceIdTRN = "trn:ImageX:*:*:ServiceId/%s" service_info_map = { REGION_CN_NORTH1: ServiceInfo( "imagex.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', IMAGEX_SERVICE_NAME, REGION_CN_NORTH1), 10, 10, "https"), REGION_AP_SINGAPORE1: ServiceInfo( "imagex-ap-singapore-1.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', IMAGEX_SERVICE_NAME, REGION_AP_SINGAPORE1), 10, 10, "https"), REGION_US_EAST1: ServiceInfo( "imagex-us-east-1.volcengineapi.com", {'Accept': 'application/json'}, Credentials('', '', IMAGEX_SERVICE_NAME, REGION_US_EAST1), 10, 10, "https"), } api_info = { "ApplyImageUpload":
import datetime from volcengine.auth.SignerV4 import SignerV4 from volcengine.auth.SignParam import SignParam from volcengine.Credentials import Credentials from collections import OrderedDict if __name__ == '__main__': sign = SignerV4() param = SignParam() param.path = '/' param.method = 'GET' param.host = 'open.volcengineapi.com' param.body = '' param.date = datetime.datetime.utcfromtimestamp(1640712206) query = OrderedDict() query['Action'] = 'ListUsers' query['Version'] = '2018-01-01' query['Limit'] = '5' query['Offset'] = '0' param.query = query header = OrderedDict() header['Host'] = 'open.volcengineapi.com' param.header_list = header cren = Credentials('ak', 'sk', 'iam', 'cn-north-1') result = sign.sign_only(param, cren) print(result)
def get_service_info(): service_info = ServiceInfo( "open.volcengineapi.com", {}, Credentials('', '', 'nlp_gateway', 'cn-north-1'), 10, 10) return service_info
import json import threading from volcengine.ApiInfo import ApiInfo from volcengine.Credentials import Credentials from volcengine.base.Service import Service from volcengine.ServiceInfo import ServiceInfo SERVICE_VERSION = "2021-03-01" service_info_map = { "cn-north-1": ServiceInfo("cdn.volcengineapi.com", { 'accept': 'application/json', }, Credentials('', '', "CDN", "cn-north-1"), 60, 60, "https"), } api_info = { "SubmitRefreshTask": ApiInfo("POST", "/", { "Action": "SubmitRefreshTask", "Version": SERVICE_VERSION }, {}, {}), "SubmitPreloadTask": ApiInfo("POST", "/", { "Action": "SubmitPreloadTask", "Version": SERVICE_VERSION }, {}, {}), "DescribeContentTasks": ApiInfo("POST", "/", { "Action": "DescribeContentTasks",