Tagged ACCS

Implementing Deploy Steps in DevCS Builds


Classic approach for deploying artefacts to Oracle Cloud Java and Application Container instances was utilising “Deployments”:

a3.png

There is a new option, now you can made deploys in build steps.

For doing that you must first create an “Environment”, watch this video to see how:

a4

After that, go to one of your builds and add an “Oracle Deployment” step:

a5.png

Now put the correct values the same way you did in the “classic” deployment, for example this is a setup for an ACCS deployment:

a6.png

And that’s all, you are done!

Last but not least, remember that you can get benefit of the PIPELINES feature and create visual workflows of steps of any king (compile, test, deploy,..)

a7.png

Hope it helps! 🙂

 

Apifying Responsys for Sending Communications (email, SMS, push) to your Customers


Intro

The idea is apify Responsys REST services and create a couple of high level rest endpoints that can be consumed from anywhere after exposing them in a container. In our use case we are utilising Application Container Cloud Service and Node.js for coding and exposing the rest endpoints respectively.

NOTE: Create an ACCS container with at least Basic Authentication. See this entry blog for more info.

Ingredients

  • A Responsys instance in with you create email and other type of templates, a couple of campaigns and things like that.
  • An ACCS container

The source code

In bold you should put your environment data.

// jmu, july 2018

var express = require('express');

var app = express();

var https = require('https');

var querystring = require('querystring');

const user = "yourresponsysuser"

const password = "yourpassword"

const responsys_token_endpoint = 'login2.responsys.net'

var credentials = { "auth_type": "password",

"user_name": user,

"password": password}

//

var token_options = {

host: responsys_token_endpoint,

port: 443,

path: '/rest/api/v1.3/auth/token',

method: 'POST',

headers: {

"Content-Type": "application/x-www-form-urlencoded"

}

};

var token = ""

// destinatario=xxx, campania=yyyy

app.get('/sendMail', function (req, res) {

let data ='';

var destinatario = req.param("destinatario", "defaultemail")

console.log(destinatario)

var elcuerpo = {

"recipientData" : [{

"recipient" : {

"customerId" : null,

"emailAddress" : destinatario,

"listName" : {

"folderName" : "AGE",

"objectName" : "AGE_List"

},

"recipientId" : null,

"mobileNumber" : null,

"emailFormat" : "HTML_FORMAT"

}

}]

}

var x = https.request(token_options,function(res){

res.on('data', (chunk) => {

data += chunk;

});

res.on('end',function(){

token = JSON.parse(data).authToken;

console.log(token);

responsys_endpoint= JSON.parse(data).endPoint.replace('https://','');

console.log(responsys_endpoint);

var campania=req.param("campania", "CASrecibo")

var restpath ='/rest/api/v1.3/campaigns/'+ campania +'/email'

console.log(restpath);

var email_campaign = {

host: responsys_endpoint,

port: 443,

path: restpath,

method: 'POST',

headers: {

"Authorization": token,

"Content-Type": "application/json"

}

};

var data1=''

var y = https.request(email_campaign,function(res){

res.on('data', (chunk) => {

data1 += chunk;

});

res.on('end',function(){

console.log(data1)

});

});

y.write(JSON.stringify(elcuerpo));

y.end();

});

});

x.write(querystring.stringify(credentials));

x.end();

res.send('');

});

// device=xxx, campania=yyyy

app.get('/sendPush', function (req, res) {

let data ='';

var device = req.param("device", "A-DEVICE-ID")

console.log(device)

var elcuerpo = {

"recipientData": [{

"customerId": null,

"emailAddress": null,

"recipientId": null,

"mobileNumber": null,

"emailSHA256Hash": null,

"emailMD5Hash": null,

"deviceId": device,

"apiKey": "anapikey",

"listType": "PUSH"

}]}

var x = https.request(token_options,function(res){

res.on('data', (chunk) => {

data += chunk;

});

res.on('end',function(){

token = JSON.parse(data).authToken;

console.log(token);

responsys_endpoint= JSON.parse(data).endPoint.replace('https://','');

console.log(responsys_endpoint);

var campania=req.param("campania", "CASpush")

var restpath ='/rest/api/v1.3/campaigns/'+ campania +'/push'

console.log(restpath);

var email_campaign = {

host: responsys_endpoint,

port: 443,

path: restpath,

method: 'POST',

headers: {

"Authorization": token,

"Content-Type": "application/json"

}

};

var data1=''

var y = https.request(email_campaign,function(res){

res.on('data', (chunk) => {

data1 += chunk;

});

res.on('end',function(){

console.log(data1)

});

});

y.write(JSON.stringify(elcuerpo));

y.end();

});

});

x.write(querystring.stringify(credentials));

x.end();

res.send('');

});

app.listen(8080, function () {

console.log('Escuchando!');

});
Enjoy 😉

Oracle IdCS Tips Part II: Simple Workflow for Creating Registered Users in IdCS with Node.js


In this post we explained how to create users in IdCS with the REST API. Typically you would like to put an approval process in between, here we explain a simple solution for those use cases where you don’t have or don’t want to put in the picture other pieces such as BPM, workflow or other typical engines.

STEP ONE AND ONLY

Create a Node.js gadget that sends an email to an approval email account with a message body that exposes an Accept and a Reject Button. The Accept button should call the create user procedure explained here.

Replace the text in bold with your own values and change the default buttons actions to a call to an exposed service that implements the create user procedure mentioned.

const nodemailer = require('nodemailer');

let transporter = nodemailer.createTransport({

host: 'estibijaif.oracol.com',

port: 465,

secure: 'estibijaif.oracol.com',

auth: {

user: 'xxxxxx@oracol.com',

pass: 'morefoolsthanbottles'

}

});

let message = {

from: 'MRO  <xxxxxx@oracol.com>',

to: 'Recipient <xxxxxx@oracol.com>',

subject: 'New user request',

text: 'Hello!',

html: '<head><style>.button {background-color: #4ecdc4;border-color: #45b7af;border-radius: 5px;text-align: center;padding: \

10px;}.button a {color: #ffffff;display: block;font-size: 14px;text-decoration: none;text-transform: uppercase;}</style> \

</head>A new user alextorrijo@acme.com from Acme has been requested, please accept or reject with the buttons as follows<table> \

<tr><td style="background-color: #4ecdc4;border-color: #4c5764;border: 2px solid #45b7af;padding: 10px;text-align: center;"> <a style="display: block;color: #ffffff;font-size: 12px;text-decoration: none;text-transform: uppercase;" href="https://javiermugueta.wordpress.com">Accept</a></td></tr><tr><td style="background-color: #4ecdc4;border-color: #4c5764;border: 2px solid #45b7af;padding: 10px;text-align: center;"><a style="display: block;color: #ffffff;font-size: 12px;text-decoration: none;text-transform: uppercase;" href="https://javiermugueta.wordpress.com">Reject</a></td></tr></table>'

};

transporter.sendMail(message, (err, info) => {

if (err) {

console.log('Error occurred. ' + err.message);

return process.exit(1);

}

console.log('Message sent: %s', info.messageId);

});
actionableemail
This Node.js procedure can be developed in Oracle Developer Cloud Service (DevCS) and deployed in Oracle Application Container Cloud Service (ACCS) easily.
See also this post
Enjoy 😉