Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import app from "../../oracle_cloud_infrastructure.app.mjs";

export default {
key: "oracle_cloud_infrastructure-create-update-object",
name: "Create Or Update Object",
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).",
version: "0.0.1",
type: "action",
props: {
app,
compartmentId: {
propDefinition: [
app,
"compartmentId",
],
},
bucketName: {
propDefinition: [
app,
"bucketName",
({ compartmentId }) => ({
compartmentId,
}),
],
},
objectName: {
propDefinition: [
app,
"objectName",
({
compartmentId,
bucketName,
}) => ({
compartmentId,
bucketName,
}),
],
},
putObjectBody: {
propDefinition: [
app,
"putObjectBody",
],
},
},
methods: {
putObject(args = {}) {
return this.app.makeRequest({
getClient: this.app.getObjectStorageClient,
method: "putObject",
...args,
});
},
},
async run({ $ }) {
const {
app,
compartmentId,
putObject,
bucketName,
objectName,
putObjectBody,
} = this;

const { value: namespaceName } = await app.getNamespace({
compartmentId,
});

const response = await putObject({
namespaceName,
bucketName,
objectName,
putObjectBody,
});

$.export("$summary", `Successfully created/updated object with client request ID \`${response.opcRequestId}\`.`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import app from "../../oracle_cloud_infrastructure.app.mjs";

export default {
key: "oracle_cloud_infrastructure-delete-object",
name: "Delete Object",
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).",
version: "0.0.1",
type: "action",
props: {
app,
compartmentId: {
propDefinition: [
app,
"compartmentId",
],
},
bucketName: {
propDefinition: [
app,
"bucketName",
({ compartmentId }) => ({
compartmentId,
}),
],
},
objectName: {
propDefinition: [
app,
"objectName",
({
compartmentId,
bucketName,
}) => ({
compartmentId,
bucketName,
}),
],
},
},
methods: {
deleteObject(args = {}) {
return this.app.makeRequest({
getClient: this.app.getObjectStorageClient,
method: "deleteObject",
...args,
});
},
},
async run({ $ }) {
const {
app,
deleteObject,
compartmentId,
bucketName,
objectName,
} = this;

const { value: namespaceName } = await app.getNamespace({
compartmentId,
});

const response = await deleteObject({
namespaceName,
bucketName,
objectName,
});

$.export("$summary", `Successfully deleted object with client request ID \`${response.opcRequestId}\`.`);
return response;
},
};
24 changes: 24 additions & 0 deletions components/oracle_cloud_infrastructure/common/constants.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const REGION_PLACEHOLDER = "{region}";

const API = {
OBJECT_STORAGE: {
ENDPOINT: `https://objectstorage.${REGION_PLACEHOLDER}.oraclecloud.com`,
VERSION_PATH: "",
},
NOTIFICATIONS: {
ENDPOINT: `https://notification.${REGION_PLACEHOLDER}.oci.oraclecloud.com`,
VERSION_PATH: "/20181201",
},
};

const TOPIC_ID = "topicId";
const SUBSCRIPTION_ID = "subscriptionId";
const RULE_ID = "ruleId";

export default {
REGION_PLACEHOLDER,
API,
TOPIC_ID,
SUBSCRIPTION_ID,
RULE_ID,
};
Loading
Loading