Skip to content

Commit 4dbe682

Browse files
authored
[Components] oracle_cloud_infrastructure - new components (#16206)
1 parent ad8ded4 commit 4dbe682

File tree

11 files changed

+1117
-10
lines changed

11 files changed

+1117
-10
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import app from "../../oracle_cloud_infrastructure.app.mjs";
2+
3+
export default {
4+
key: "oracle_cloud_infrastructure-create-update-object",
5+
name: "Create Or Update Object",
6+
description: "Create or update an object in a specified Oracle Cloud Infrastructure Object Storage bucket. [See the documentation](https://docs.oracle.com/en-us/iaas/api/#/en/objectstorage/20160918/Object/PutObject).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
compartmentId: {
12+
propDefinition: [
13+
app,
14+
"compartmentId",
15+
],
16+
},
17+
bucketName: {
18+
propDefinition: [
19+
app,
20+
"bucketName",
21+
({ compartmentId }) => ({
22+
compartmentId,
23+
}),
24+
],
25+
},
26+
objectName: {
27+
propDefinition: [
28+
app,
29+
"objectName",
30+
({
31+
compartmentId,
32+
bucketName,
33+
}) => ({
34+
compartmentId,
35+
bucketName,
36+
}),
37+
],
38+
},
39+
putObjectBody: {
40+
propDefinition: [
41+
app,
42+
"putObjectBody",
43+
],
44+
},
45+
},
46+
methods: {
47+
putObject(args = {}) {
48+
return this.app.makeRequest({
49+
getClient: this.app.getObjectStorageClient,
50+
method: "putObject",
51+
...args,
52+
});
53+
},
54+
},
55+
async run({ $ }) {
56+
const {
57+
app,
58+
compartmentId,
59+
putObject,
60+
bucketName,
61+
objectName,
62+
putObjectBody,
63+
} = this;
64+
65+
const { value: namespaceName } = await app.getNamespace({
66+
compartmentId,
67+
});
68+
69+
const response = await putObject({
70+
namespaceName,
71+
bucketName,
72+
objectName,
73+
putObjectBody,
74+
});
75+
76+
$.export("$summary", `Successfully created/updated object with client request ID \`${response.opcRequestId}\`.`);
77+
return response;
78+
},
79+
};
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import app from "../../oracle_cloud_infrastructure.app.mjs";
2+
3+
export default {
4+
key: "oracle_cloud_infrastructure-delete-object",
5+
name: "Delete Object",
6+
description: "Delete an object from a specified Oracle Cloud Infrastructure Object Storage bucket. [See the documentation](https://docs.oracle.com/en-us/iaas/api/#/en/objectstorage/20160918/Object/DeleteObject).",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
compartmentId: {
12+
propDefinition: [
13+
app,
14+
"compartmentId",
15+
],
16+
},
17+
bucketName: {
18+
propDefinition: [
19+
app,
20+
"bucketName",
21+
({ compartmentId }) => ({
22+
compartmentId,
23+
}),
24+
],
25+
},
26+
objectName: {
27+
propDefinition: [
28+
app,
29+
"objectName",
30+
({
31+
compartmentId,
32+
bucketName,
33+
}) => ({
34+
compartmentId,
35+
bucketName,
36+
}),
37+
],
38+
},
39+
},
40+
methods: {
41+
deleteObject(args = {}) {
42+
return this.app.makeRequest({
43+
getClient: this.app.getObjectStorageClient,
44+
method: "deleteObject",
45+
...args,
46+
});
47+
},
48+
},
49+
async run({ $ }) {
50+
const {
51+
app,
52+
deleteObject,
53+
compartmentId,
54+
bucketName,
55+
objectName,
56+
} = this;
57+
58+
const { value: namespaceName } = await app.getNamespace({
59+
compartmentId,
60+
});
61+
62+
const response = await deleteObject({
63+
namespaceName,
64+
bucketName,
65+
objectName,
66+
});
67+
68+
$.export("$summary", `Successfully deleted object with client request ID \`${response.opcRequestId}\`.`);
69+
return response;
70+
},
71+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const REGION_PLACEHOLDER = "{region}";
2+
3+
const API = {
4+
OBJECT_STORAGE: {
5+
ENDPOINT: `https://objectstorage.${REGION_PLACEHOLDER}.oraclecloud.com`,
6+
VERSION_PATH: "",
7+
},
8+
NOTIFICATIONS: {
9+
ENDPOINT: `https://notification.${REGION_PLACEHOLDER}.oci.oraclecloud.com`,
10+
VERSION_PATH: "/20181201",
11+
},
12+
};
13+
14+
const TOPIC_ID = "topicId";
15+
const SUBSCRIPTION_ID = "subscriptionId";
16+
const RULE_ID = "ruleId";
17+
18+
export default {
19+
REGION_PLACEHOLDER,
20+
API,
21+
TOPIC_ID,
22+
SUBSCRIPTION_ID,
23+
RULE_ID,
24+
};

0 commit comments

Comments
 (0)