Skip to main content

cloudrun

Cloud Hosting

Note

In v3, when calling storage-related APIs, it uses the open capability of Cloud Hosting HTTP API. Before using, please visit Cloud Development Platform/Identity Verification/Permission Control to confirm whether the policy management configuration of CloudrunHttpApiAllow for the corresponding role meets expectations. For details, refer to the Policy Management Documentation.

callContainer

callContainer(object: Object): Promise<Object>

1. API Description

API feature: Call the cloud hosting service.

2. Input Parameters

object
Object

3. Output Parameters

Service execution error, exception thrown

Promise
Object

4. Example code

import cloudbase from "@cloudbase/js-sdk";

// Initialize SDK instance
const app = cloudbase.init({
env: "xxxx-yyy",
});

app
.callContainer({
name: "helloworld",
method: "POST",
path: "/abc",
header: {
"Content-Type": "application/json; charset=utf-8",
},
data: {
key1: "test value 1",
key2: "test value 2",
},
})
.then((res) => {
console.log(res);
});