aws quicksight command line not giving any result - aws-cli

Trying to create a template to duplicate an analysis and getting nowhere using cli...
I need describe-dashboard to get the arn of the datasource for example, but it doesn't describe anything (the dashboard exists of course). And even when I guess the datasource arn, the command create-template gives the same "Status: 200" answer without creating the template.
1°) describe-dashboard and create-template use wrong endpoint:
https://quicksight.us-est-1.amazonaws.com/accounts/xxxxxxxxxxxxxx/templates/xxxxxx
2°) Even when correcting it it only returns
{"Status": 200}
without any info on the dashboard or template... Does someone have any pointers ?
Example :
aws quicksight describe-dashboard --aws-account-id "xxxxxxx" --region "us-est-1" --dashboard-id "xxxxxxxxxxxxxxxx" --endpoint-url "https://us-east-1.quicksight.aws.amazon.com/sn/dashboards/"

Related

Can Azure batch transcription results be directed to a non-public url

I would like to use the Microsoft Azure Cognitive Service Speech-to-text. It offers a REST API, which I succesfully have used. I can point to an Azure blob storage using a SAS URI, and the files in the container are transcribed.
My problem is, that when I try to retrieve the transcription results from the API, they are published to a public url. Since voice data can be sensitive, I would like to keep the results stored privately. Is there any way to do this?
I does not seem like it is an option in the API schema, although you can set a destinationContainerUrl. I have tried to set the destinationContainerUrl, but the result does not appear in the container.
I have only used the API reference, which is why I am not posting any code.
You've found the correct option. Using destinationContainerUrl will write the results into this container. Make sure you provide a container SAS which allows listing and writing.
When the job succeeds, the results should be there. Please check that status of your job, maybe it was set to failed.
Documentation about transcriptions:
https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/batch-transcription
If the job succeeds and the files are not on this container, please let us know the $.self link of the job and the creation time, to help us gathering the logs.
Ok. So the solution was super simple. I just did the post request json wrong. destinationContainerUrl needs to be under properties, as shown below:
{"contentUrls": ["LINK-TO-BLOB-SAS-URI-TOKEN"],
"properties": {
"diarizationEnabled": false,
"wordLevelTimestampsEnabled": false,
"punctuationMode": "DictatedAndAutomatic",
"profanityFilterMode": "Masked",
"destinationContainerUrl": "LINK-TO-BLOB-SAS-URI-TOKEN"
},
"locale": "en-US",
"displayName": "Transcription from blob to blob"
}

Importing a ZIP file to Dialogflow Agent gives "Language " not supported by platform" error

I am trying to restore a backup agent to a new agent in Dialogflow. I've gone to my existing agent and exported with no problem.
But when I go to restore it to a new agent I get this error:
DF Error
I've opened up the zip file and looked into the agent.json and it looks like the agent key is set properly:
"description": "Allow your app to engage in small talk about a variety of topics.",
"language": "en",
"shortDescription": "Small talk topics to help make your bot more personable",
"examples": "User: Hello!\nUser: How are you?\nUser: Thank you!\nUser: You\u0027re welcome.\nUser: What\u0027s up?\nUser: I\u0027m bored.\nUser: I\u0027m joking.\nUser: Well done!\nUser: Who are you?\nUser: How old are you?\nUser: You\u0027re clever.\nUser: What do you do for fun?",
Anyone else run into this?
Update: I reached out to support and was able to get this solved. For some reason my agent did not have the "lang" key populated in all the intents, even though it worked just fine in the existing agent.
Dialogflow support fixed the issue in my agent and emailed me the correct zip file.

API call IBM Watson Natural Language Understanding-xq - Python or Postman

I'm struggling to connect to the IBM Watson API for Natural Language Understanding.
I've added it to the Resource list in my IAM account. I've got to the page with an example POST request to connect to the API, and I can't seem to authenticate. I've blanked out the API key from this request but in the pages the key is supplied so I'm struggling to see why it's not working
curl -X POST -u "#######" \
-H "Content-Type: application/json" \
-d '{ "text": "I still have a dream. It is a dream deeply rooted in the
American dream. I have a dream that one day this nation will rise up and
live out the true meaning of its creed: \"We hold these truths to be
self-evident, that all men are created equal.\"", "features": {
"sentiment": {}, "keywords": {} }}' \
"https://gateway-lon.watsonplatform.net/natural-language-
understanding/api/v1/analyze?version=2018-03-19"
I've tried pasting this into Postman but I just get a 401 Unauthorized response, which makes me think it's something in the account pages of the IAM, but they've chnage the interface and not update the documentation, and I'm going round in circles because the instructions don't match the menus.
Any pointers would be appreciated. I intend to query through Python, so I'm hoping once I can get past the authentication issue it's as simple as copying the Python code out of Postman
Your -u credentials should be:
-u "apikey:#######"
As per the API documentation -
https://cloud.ibm.com/apidocs/natural-language-understanding#authentication
Somehow the API credentials were not being recognised. I must have done something wrong in the initial IAM setup, which meant that when I deleted the credentials, re-created them and then copied the new key ... everything immediately started working. Complete mystery as to why but hopefully this helps someone. Here are the instructions I followed
https://console.bluemix.net/docs/services/natural-language-understanding/getting-started.html#getting-started-tutorial
I used the SDK as suggested by Simon O'Doherty
It might also be related to me having gone into the "Manage" >> "Account" and deleted any Access Groups and Service IDs I'd attempted to create by following the "Getting Started with IAM" instructions from here, which I suspect might have been what confused me
IAM getting started (not required)

How to find an alchemy API key?

I was wondering where can I find my alchemy API key on Bluemix? I looked at the following question on SO (Where to get the Alchemyapi API key?) however, my bluemix looks nothing like that.
I do not have an apikey field, only username and password along with a url. IBM's documentations are approaching the usefulness of Java Docs (I.E, loads of info very little as far as demos go)
Below is how my creds look like:
{
"url": "so_url",
"username": "3e49e046-....",
"password": "XXXX"
}
I downloaded the npm module using the following instructions (https://www.npmjs.com/package/watson-developer-cloud#alchemylanguage) it mentions that username and password are the api key, so do they just get concatenated together? Is there anything that I missing from my Bluemix by chance?
The way i have my api key now, i.e where it is just username and password merged together returns an invalid api key error.

AuthorizationError when confirming SNS subscription over HTTP

I'm writing a simple SNS client that is meant to subscribe itself to an SNS topic and then listen for notifications. I can successfully submit a sns.subscribe request, but when I pick up the SubscriptionConfirmation POST message from AWS and try and respond using sns.confirmSubscription I get an AuthorizationError returned:
[AuthorizationError: User: arn:aws:iam::xxx:user/mv-user is not authorized to perform: SNS:ConfirmSubscription on resource: arn:aws:sns:us-east-1:xxx:*]
If I use exactly the same Token and TopicArn in a GET query to the server the subscription confirmation works fine, with no authentication.
Any ideas why it's not working? My SNS topic is wide open with publish/subscribe permissions set to 'Everyone'.
For reference, my code is something like this:
var params = {
TopicArn: topicArn, // e.g. arn:aws:sns:us-east-1:xxx:yyy
Token: token // long token extracted from POST body
};
sns.confirmSubscription(params, function (err, data) {
if (err) {
// BOOOM - keep getting here with AuthorizationError
} else {
// Yay. Worked, but never seem to get here :(
}
});
However, if I navigate to the URL similar to this in a browser (i.e. completely unauthenticated), it works perfectly:
http://sns.us-east-1.amazonaws.com/?Action=ConfirmSubscription&Token=<token>&TopicArn=arn%3Aaws%3Asns%3Aus-east-1%3Axxx%3Ayyy&Version=2010-03-31
The only differences seem to be the inclusion of 'Authorization' and 'Signature' headers in the programmatic version (checked using Wireshark).
Any ideas? Thanks in advance!
Update
In my code, if I just programatically do a simple GET request to the SubscribeURL in the SubscriptionConfirmation message this works fine. Just seems odd that the confirmSubscription API call doesn't work. Will probably stick to this workaround for now.
Update 2
Also get the same error when calling sns.unsubscribe although, again, calling the UnsubscribeURL in each notification works. Seems other people have run into that issue too but can't find any solutions.
I faced a similar issue while developing my application.
The way I ended up solving it is the following:
go to IAM and click on your user
go to the permissions tab and click on "Attach Policy"
use the filter to filter for "AmazonSNSFullAccess"
Attach the above policy to your user.
The above should take care of it.
If you wanna be fancy you can create a custom policy that is based on "AmazonSNSFullAccess" and apply it to you user instead.
The custom policy would be something similar to the following:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"sns:ConfirmSubscription"
],
"Effect": "Allow",
"Resource": "YOUR_RESOURCE_ARN_SHOULD_BE_HERE"
}
]
}
The error says it all:
[AuthorizationError: User: arn:aws:iam::xxx:user/mv-user is not authorized to perform: SNS:ConfirmSubscription on resource: arn:aws:sns:us-east-1:xxx:*]
is basically telling you that the IAM user you're using to call ConfirmSubscription doesn't have the proper permissions to do so. Best bet is to update the permissions for that IAM user, specifically adding ConfirmSubscription permissions.
(Based on your comments, even though the documentation says otherwise, the error is pretty specific... might be worth following up directly with AWS about this issue, since either the error message or documentation is incorrect).

Resources