I'm working on application which will get DNS entries of each of my CIS instances. To get CIS DNS records I need to provide CRN and ZoneID, however from resource controller I'm able to get only resource CRN. How to get related ZoneID?
I suggest a flow of
obtain your instances by retrieving them from the resource list (resource controller)
retrieve the zones from your CIS instance (https://cloud.ibm.com/apidocs/cis#list-zones)
retrieve the DNS entries for your CIS zones
Related
Is there any way to get data for a single media obtained with business discovery? Here's my use case:
I use business API to get media from certain users.
I save all the post data, including media ID, images, etc., to build a gallery.
Once in a while, some media URLs expire, and the gallery starts to show broken images, so I need a function that refreshes the posts that have expired images via API in order to get the new media URLs.
To do that, I need to access the single media. I tried with direct media ID
GET /{media-id}
But I got
Unsupported get request. Object with ID '17893828628657031' does not exist, cannot be loaded due to missing permissions, or does not support this operation.
I don't have direct access to media discovered with business discovery API.
Any suggestions?
It seems that I don't have direct access to media discovered with business discovery API.
Yes, that appears to be the case. In the endpoint documentation, in the section titled "Getting Basic Metrics on Media", it explicitly says:
You can use both nested requests and field expansion to get public fields for a Business or Creator Account's media objects. Note that this does not grant you permission to access media objects directly — performing a GET on any returned IG Media will fail due to insufficient permissions.
So I guess you could only make the original business discovery request again - and then update your data storage with the current URLs this returns. If the account added new media since your last request, you might need to paginate through the results, to find your specific older media item IDs in there again.
I had a question regarding global availability of an API and performance. Basically, we would like to build an API that is central to our business, but it must be highly available and performant globally, meaning, response times of the API should be minimal whether the call is being made in the United States, China, or any other country in the world. The API is actually an interface into a microservice architecture that is domain driven. We are currently using Microsoft Azure as our cloud provider to host these microservices but I wanted to get some suggestions on architecting a solution that makes this performant across the globe. Would we need to deploy services in multiple regions to be able to make this work? If so, how would I route an incoming request to the appropriate region?
I would partition your data by region using username as the partition key. Distribute your microservices and databases around the world in appropriate places, but keep one central login service. As users register with your central registration service, you assign them to a region depending on their home address, IP, or some other geographical indicator. When they return to login the second time (using the central service), you authenticate them and pull their region from the central DB. You can now route all additional traffic to the proper region for the best performance.
You would have to implement a full set of domains in each region.
This may look a dumb question to you. However, I am looking for a way to fetch API Connect internal data i.e. number of invocations of APIs exposed via API Connect , by which client etc. I know, there are individual dashboard/chart within API Connect. But, I want to build a explicit tool to monitor the same leveraging API Connect data.
is it at all possible ?
Thanks in advance
See the KC at https://www.ibm.com/support/knowledgecenter/SSMNED_5.0.0/com.ibm.apic.apionprem.doc/rapim_analytics_apieventrecordfields.html which will explain how to get the info you want.
Procedure
To obtain analytics data for a Catalog and API provider organization, issue the following call:
GET /v1/orgs/{orgId}/environments/{envId}/events
where
{orgId} is either the URL path segment or the ID of the API provider organization.
{envId} is either the URL path segment or the ID of the Catalog.
The following example shows a call that is issued from a browser and then shows all the event fields in the corresponding response. The call is issued to return two analytics events (limit=2), and includes a next parameter for requesting further events.
https://api-manager-server.company.com/v1/orgs/macs-shack/environments/sb/events?next&limit=2
I'm working on a java application that requires getting all users from Instagram's api endpoint /users/search that match a given name. The maximum number of user objects returned seems to be 50. I created an instagram profile for a common name to test this, and I call it with:
https://api.instagram.com/v1/users/search?q=Common%20Name&client_id=CLIENT-ID
Which returns a list of 50 profiles that have matching/similar full names and usernames. The profile I created is not among them. I know it exists, however, because I am the one who created it and I can still access it with the specific id using:
https://api.instagram.com/v1/users/USER-ID/?client_id=CLIENT-ID
Some of the instagram endpoints have pagination, which would make this easy, but this endpoint does not. Is there a consistent method to find ALL users with a matching/similar full name to the one provided in the /users/search endpoint?
In my MVC application, I want to display Country, Region and City of the user from where he is accessing the website. How can I fetch them?
There are several ways. One is to ask the user to share his location with the remote server.
https://developer.mozilla.org/en-US/docs/WebAPI/Using_geolocation
The other involves "guessing" using the remote ip address and some service like this:
http://freegeoip.net/