Interact with IBM services from Slack using Nimbella Commander.
- IBM Cloud Functions
- IBM Watson Visual Recognition
- IBM Watson Language Translator
- IBM Watson Tone Analyzer
These commands are intended for use with Nimbella Commander. Please install Commander in your Slack team first. Next, install this command set into your workspace by running the following command.
/nc csm_install ibmCommands related to IBM Cloud Functions.
Create a secret named ibmApiKey using /nc secret_create with the value being an IBM API key which can be obtained at https://cloud.ibm.com/iam/apikeys.
The default region is London (eu-gb). You can set your region by creating a secret named ibmRegionCode.
-
namespaces- List your IBM IAM and Cloud Foundry-based namespaces. -
activations- List activation records in a namespace. -
act_log- Get the logs for an activation. -
act_result- Get the results of an activation. -
actions- List all actions, web actions, and action sequences in a namespaces. -
invoke- Invoke an action, web action, or action sequence.
/nc namespaces [-skip <skip>]By default, first 20 namespaces are shown. You can skip through the list by using -skip.
/nc activations [<namespaceId>] [-skip <skip>]You can create a secret named ibmNamespaceId to avoid passing the same id on every invocation. And the parameter is given precedence when both are present.
By default, first 9 activation records are shown. You can skip through the list by using -skip.
/nc act_log <activationId> [<namespaceId>]/nc act_result <activationId> [<namespaceId>]/nc actions [<namespaceId>] [-skip <skip>]By default, first 20 actions are shown. You can skip through the list by using -skip.
/nc invoke <actionName> [-nsId <nsId>]You can pass parameters to your function as flags. To pass namespace ID, use -nsId flag. Example: /nc invoke <actionName> -nsId "aasdfasd2r435232sdgfw25"
Example:
/nc invoke <actionName> [<namespaceId>] -name "Nimbella". # { name: "Nimbella" }This command uses the Watson Visual Recognition service to label images.
You need to configure this service with an API key for the Watson Visual Recognition service. If you don't have an instance of this service, please create one first. Then visit the Service credentials page for this resource, click on View credentials and copy the API key for this service. You will use this API key with the Nimbella Secret Creator to encrypt the API key and use it with the command.
- Run
/nc secret_createin your workspace and click the link provided. - in the Name field enter
ibmWatsonVisualRecognitionCredentialsand enter the API key in the corresponding Value field. - Press Make Secrets and follow the instructions shown.
/nc watson-viz <imageUrl>For example:
/nc watson-viz https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg
Translate text right from your Slack workspace using Nimbella Commander & IBM Watson Language Translator.
Traducir means 'translate' in Spanish.
First, create a Language Translator resource. After the resource is created, head over to Service credentials page of the resource and click on View credentials and copy everything including the curly braces.
This is how the values might look:
{
"apikey": "...",
"iam_apikey_description": "...",
"iam_apikey_name": "...",
"iam_role_crn": "...",
"iam_serviceid_crn": "...",
"url": "..."
}Head over to the Secret Creator (type /nc secret_create in your workspace to get the link) and fill in the Name field with ibmLanguageTranslatorCredentials and paste the copied values in the corresponding Value field. Press Make Secrets button and follow the instructions.
/nc traducir <text> <targetLanguage>You need to use language code instead of language name for targetLanguage.
Example:
/nc traducir "Hello, Developers!" es # es -> SpanishRefer this page for language codes.
Analyze tone of a text right from your Slack workspace using Nimbella Commander and IBM Watson Tone Analyzer.
First, create a Tone Analyzer resource. After the resource is created, head over to Service credentials page of the resource and click on View credentials and copy everything including the curly braces.
This is how the values might look:
{
"apikey": "...",
"iam_apikey_description": "...",
"iam_apikey_name": "...",
"iam_role_crn": "...",
"iam_serviceid_crn": "...",
"url": "..."
}Head over to the Secret Creator (type /nc secret_create in your workspace to get the link) and fill in the Name field with ibmToneAnalyzerCredentials and paste the copied values in the corresponding Value field. Press Make Secrets button and follow the instructions.
/nc tone "How are you doing?"To analyze customer tone:
/nc tone_cs "Please fix the issue!"