call AWS POST API with AWS Signature Version 4 - datastage

did someone already called an AWS Rest API with AWS Signature Version 4 ?
I'm not sure how to generate this using the hierarchical stage Calling the Rest API ?
Thank You -

what do you mean by hierarchical stage, do you want to build the whole signature on your own?
Which language are you trying to call it with? There are different packages depending on that, I highly recommend using one of those instead of rebuilding it on your own.
agnostic-aws-signature This worked for me for example...

Related

Use an existing DynamoDB datasource with Amplify and AppSync

I have a working app I made using Amplify (with AppSync API and Cognito). I'd like to make another app which is different, but shares some data with my first project (same product, but different targets, usages and security rules).
Is there a clean way to use Amplify for that new project, telling the GraphQL API to fetch some data in the DynamoDB from my first Amplify project ?
This data will change often and will be heavy - so I'm not too much into any synchronization solution.
I thought about those solutions, but I'm not experienced enough to tell if one of them is good:
Not using Amplify but SAM for this new project (but I will lose all the build pipeline provided by Amplify)
Using Amplify for the Hosting and the Auth, but configure AppSync with SAM and plug it into my existing DataSource
Maybe CloudFormation can be the answer, but I don't see how to interact directly with it within Amplify
There is an article from Amazon about microservice architectures that might be useful for you
https://aws.amazon.com/blogs/mobile/appsync-microservices/
I'm not sure if Amplify supports adding multiple APIs to it, if so, you could add it and then pull only that api on it.
IMO the easiest approach would be just creating a query endpoint to fetch the data from your other datasource, using lambda.
So, in that case you would edit your schema to something like this
query
{
externalData [ExternalData] #function(name: "getExternalData")
}
Then you need to add the lambda function getExternalData, which will be responsible to query the data as needed.
The article above has more in-depth details about this architecture

can I add custom nested CloudFormation stack to AWS Amplify OR can I create a custom Lambda function/SQS with GraphQL/AppSync?

Spending more than a day I doubt the answer is Yes.
Want to double check though.
Creating Lambda functions is possible with REST APIs. But I need it with GraphQL. As I understand, currently creating Lambda function from CLI for GraphQl is not supported - right ?
In my app one party places an order => mutates DynamoDB table Orders => DynamoDB triggers a Lambda function that in turn mutates DynamoDB table Offers (changes offer's status). This change should notify subscribed parties.
I could do it in a separate Lambda function or in a Lambda function that serves as a Resolver. But either way I do not see a way of doing it using AWS Amplify.
Resolver Lambda function should also be manually added in console (providing Lambda ARN). Is there a way of adding it using CLI or config files or nesting a CloudFormation stack template ?
I know I can do all manually in console. But I need to find a way using AWS Amplify so that I have a parent and nested CloudFormation stack templates.
Possible workaround I see is:
setting up GraphQL API using AWS Amplify;
setting up rest of the serverless environment with AWS SAM or Serverless Framework;
have to manually connect (in console) Lambda and SQS with AppSync's DynamoDB.
Is my understanding correct? Is there a better way than this workaround ?
I am building my front end app in React. This AWS Amplify page shows how resources such as SQS can be created for iOS. Is there anything similar for React ?
Thank you

Deploy application in IBM Cloud using only Rest API

I am an intern and currently doing automation on a software. What I need to do is to automate the process of creating, and starting an application in the cloud foundry using Rest API (rest-assured). I can't start an app because to start it I need to upload bits. I searched for weeks and still cannot find how to do it. I can only use V2 of the Cloud Foundry API, because when I create an app using the V3 API it doesn't show in the dashboard. I don't know why so we decided to just leave it and use V2 instead.
My question is: Is there any way to create, and deploy/start an app using only Rest API with the V2 API of the Cloud Foundry API? If there is a way to do this by using V3 API, I'm willing to search for the solution to solve the issue.
Thank you very much.
I think others commented on your question to use the cf command line, but if you want to use whats behind the scenes of cf then you can refer to the REST API Docs. At the top the page there is a API version selector (I linked 2.9.0 since you mentioned V2).
More specifically, to create an app you can use the Create App Endpoint; then to upload the bits, you can use Upload Bits Endpoint.
I hope this helps. Definitely check out the main docs, there are tons of endpoints that might be useful. Good luck on your internship!
EDIT: Just in case you need the CF API URL its https://api.ng.bluemix.net
If you want to see how the cli uses the rest api behind the scenes you can temporarily set the environment variable BLUEMIX_TRACE with the command line EXPORT BLUEMIX_TRACE=TRUE.
Then you can try doing cf push or cf start, cf stop, etc, and you will see the http requests the CLI uses. This has helped me a lot versus digging through the CF documentation :). Hope it helps!
I solved it by combining V3 API with V2 API. I understand the upload bits in V3 API. I use link[1] mainly to start the app. I think you can't create a route in V3 API because I don't see any endpoint for that, so I use V2 API instead to create and assign. I also use V2 API to create my app because of what I stated in my question. Thanks for answering the question because without the answers given by good people here I can find the best way to solve this.
[1] Create an App using V3 : https://github.com/cloudfoundry/cloud_controller_ng/wiki/How-to-Create-an-App-Using-V3-of-the-CC-API
[2] V2 API doc : https://apidocs.cloudfoundry.org/3.1.0/routes/list_all_apps_for_the_route.html .
[3] V3 API doc : http://v3-apidocs.cloudfoundry.org/version/release-candidate/index.html#get-assigned-isolation-segment

How to call ResolveCustomer and GetEntitlements from aws-marketplace using aws-sdk-go?

I need to call ResolveCustomer and GetEntitlements services using aws-sdk-go. There is no code samples available on how to configure the aws clients for such calls.
Can someone help with the go code examples?
It will be helpful if someone has done unit testing for such calls; in terms of how to mock the ResolveCustomer and GetEntitlements API calls in golang?
The MarketPlaceMetering package's New function, https://docs.aws.amazon.com/sdk-for-go/api/service/marketplacemetering/#New, has a short example of creating a MarketPlaceMetering client.
GetEntitlements is part of the MarketplaceEntitlementService package, so see that package's New function, https://docs.aws.amazon.com/sdk-for-go/api/service/marketplaceentitlementservice/#New, for a short example of creating a MarketPlaceEntitlementService client.
For more info on configuring the SDK, see https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/making-requests.html.
Note that these are both in the V1 version of the Go SDK. Feel free to browse the V2 version, https://github.com/aws/aws-sdk-go-v2, which has some differences in how you create a client (you should be able to figure it out from the DynamoDB example there).

Unable to get Requirements coverage information from QC 12 via REST api?

Unable to get Requirements coverage information from QC 12 via REST api?
I am using QC 12 in my project. Can anyone tell me is it possible to get test coverage information from requirements via QC 12 using REST api?
Rest api is preview version and not fully available as OTAClient api. Many functions are not available. Few enhancements are made in 11.5 and 12.0/2 but still it lacks many of the function. Better you use OTAClient which is full fledged api to communicate with HP.
Only requirement traceability links are added in rest version of 12.0/2
there is a possible workaround for that. First point should be the usage of a QC version higher than 11.
Having said that, it is possible to use a call to "requirement-coverages" and check for the required "required-id", for instance:
1)
GET https://SERVER/qcbin/rest/domains/DOMAIN/projects/PROJECT/requirement-coverages?query={requirement-id[10];}
This will give you back an xml file (in case requirement exist) with a list of "test-ids" linked to that requirement.
Already at this point you have the knowledge of "test-coverage"--> each test cases will have his own "pass or fail".
2) If you are looking for a specific test-id, then you can check if in those test-ids is available the test-id you are looking for.
Hopefully the command above solve your query. I know that this is quite late reply, but hope to help somebody else! Have a nice day.
Try this api. You will get all the requirement to requirement mappings.
http://SERVER/qcbin/rest/domains/DOMAIN/projects/PROJECT/req-traces?login-form-required=y
Also if you need a list of all the api's exposed in REST, use the below link:
http://SERVER/qcbin/rest/resource-list .