How to call ResolveCustomer and GetEntitlements from aws-marketplace using aws-sdk-go? - 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).

Related

How to call Realm function via HTTP?

I need to call realm function via HTTP not sdk. Looks like it is possible, but I can not figure it out.
Reason behind it is simple, I do not need anything sdk provides us, I just want to get the data from db. Also I have a problem with sdk cos it's trying to create a folder related to sync (I do not need sync at all! This is big question why Mongo dev team did it this way) in google cloud function where I get the error about read/write permissions.
Would be grateful for any help
I found the answer is pretty obvious we just need to use web sdk not node sdk cos web does not have anything related to sync

call AWS POST API with AWS Signature Version 4

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...

Dynamically Change API Environments Google Rollout Track

I'm developing an Ionic(3 / 4)(Angular 4 - 7)-Cordova / Capacitor Cross Platform Application(s). I'm interested in switching API env based on the current rollout track in the Google Play Store. For example, once an application has been successfully tested and recommended to continue staging/production. I would like to have the API env dynamically changed (e.g., using a different URI domain to connect to REST API ) dependent on the Google Play Store Track.
I'm aware that I can use Google Developer Play Store API to identify / list versions and available tracks yet, I'm unaware if there's already an implementation or solution. I'm perfectly willing to design a solution though, I figure I find out if it's been done already rather than reinvent the wheel.
I'm hoping to implement a solution either to the REST API BACKEND or in the ionic framework layer rather than an integration at the native layer for scalability per-project. The purpose of doing this would enable CI rather than rebuilding the project and change the API URI domain for every environment. Any assistance in this matter would be greatly appreciated.
So, if anyone's interested. The approach highlighted above is possible, couldn't get an answer so I just created something. Using Google Play Developer API. The process flow is as follows:
[]
For now it's a working prototype perhaps its not very efficient; I suppose it can be improved if the request was issued from a single server, or microservice. Though, I wanted to make the code recyclable and it's isolated from both the mobile application & Node Server.
If you are interested in learning more or would like to work on project. Please feel free to contact me.

How to add devices using openHAB REST API

I am looking for a way to discover a USB zstick "/dev/ttyACM0" using OpenHab command line interface as I am not going to be using a GUI and I need to create a script to automate few things.
In their website here and here OpenHab have some documentation, and that's what I found for discovery:
GET /discovery
POST /discovery/bindings/{bindingId}/scan
however I was unable to make that into a useful curl command. any idea on where to start?
I would suggest to try out the REST Documentation, for finding the right endpoint/expression.
You can install it through paper ui:
It will then be available through <YOUR_OH_IP>:<PORT>/doc/index.html.
It provides some ui with explanations and examples for the endpoints and you can test them live through it.
This should help you find the correct rest call to use with curl afterwards.
I don't know if adding devies through REST is possible. If so you can find it in the REST Documentation.
If it doesn't work though the REST API you might want to write a small bash script which adds the things you want. Then you can call your script with
executeCommandLine in a rule

Generating Dynamically OpenTok Session ID from iOS

I am using OpenTokSDK for iPhone (using it Natively)
I have made the code for calling but just there is one problem.:-
I have to statically Add the SessionID. But i want to generate the ID Dynamically.
How can I do this ?
Please help!
Thanks In Advance
Full disclosure: I am a developer for TokBox.
The only safe way to get session ID and token credentials to the device is by developing an application server that suits the specific needs of your app. We have a number of server-side SDKs available on GitHub (link) that will interface with the OpenTok server API to generate this data.
Note well the server-side SDK is enough to get your credentials generated, but not all devices will be on the same session, so things like user management and application workflows are all considerations that cannot be easily written to an open source library.
That said, we did try to make some of these examples more clear by writing code examples on our blog (link). You can relieve much of the overhead of writing your own application server (no doubt a daunting task, especially the first time around) by leveraging one of the third party signaling services available, like Parse and Pusher, to name two.
Wobbals is correct, and In addition to what Wabbals has mentioned, generating sessions/tokens is very simple, the sample code required for each server language (PHP, NodeJS, C#, Ruby) is located in OpenTok's Github page.
Furthermore, if you choose not to have server side code and use Parse to handle your back-end, there is a wonderful writeup about how to use Parse's cloud code module for OpenTok to generate sessions and tokens.
Good Luck!
I strongly felt that the tokbox tutorial was quite basic but had steeper learning curve. So I ended up wrote out my own app-cum-tutorial.
Though late, I felt compelled to post here:
How To write your first iPhone Video Chat App using parse and opentok(tokbox)