Does some one know how can I get the status of the federation links using the RabbitMQ's HTTP APIs? I am able to get the definition of the federation upstream by the following example, but can't find a way to get its status.
Call - http://[hostname]:15672/api/parameters/federation-upstream returns me
[{"value":{"uri":["amqp://USER:PASSWORD#HOSTNAME:4003/VHOST"],"trust-user-id":false,"exchange":"anurag.fed"},"vhost":"VHOST","component":"federation-upstream","name":"upstream-fed"}]
The official documentation says, the link status can be monitored by rabbitmqctl or GUI, but it does not mention HTTP apis anywhere. Does this mean that rabbitmq does not have this capability in APIs? If it has can someone please help?
https://www.rabbitmq.com/federation-reference.html
"You can monitor the status of federation links using rabbitmqctl and the management plugin."
RabbitMQ version being used: 3.6.8
Thanks,
Anurag
The RabbitMQ management UI uses REST calls to fetch data, and you have the ability to trace those calls:
Enable the rabbitmq_federation_management plugin. Via the web UI, browse to the page showing the status you're looking for. Then, open the developer tools in your web browser to trace the network requests and responses. You will see requests to various /api REST resources - one of them will be what you can use in your application.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
You can call http://[hostname]:15672/api/federation-links which will retrieve a json which contains the status field, like this:
[
{
"node": "rabbit#hostname",
"exchange": "exchange_name",
"upstream_exchange": "exchange_name",
"type": "exchange",
"vhost": "/",
"upstream": "upstream_name",
"id": "blablabla",
"status": "running",
"local_connection": "<rabbit#hostname9>",
"uri": "amqp://hostname:5672/%2f",
"timestamp": "2019-03-15 13:57:57",
}
Related
we have rest point to get the resource information from keycloak server.
http://{host}:{port}/auth/realms/{realm}/authz/protection/resource_set/{resource_id}
from this endpoint I can get only one resource information.
-{
"name": "/TestResource",
"type": "customer",
"ownerManagedAccess": false,
"displayName": "testresource",
"_id": "****resource id****",
"icon_uri": "testIconUri",
"uris": [
"/uri2",
"/uri1"
],
"resource_scopes": [
{
"name": "GET"
}
]
}
But, In my case i have more than 25 resources to be loaded in my menu of application.
If i go with above endpoint, i need to call the same service for more than 25 times . so i need some other way to get set of resources information using single endpoint.
I expect a solution for this,
thankyou in advance.
I found the solution.
we can get all the authorization related details using
http://{host}:{port}/auth/admin/realms/{realmname}/clients/{clientId}/authz/resource-server/settings
provided by keycloak.
we have to use admin credentials
{clientId} is not the Client Name given by you. it is generated by keycloak for each client
We've built a SMAPI implementation that is serving up audiobooks. We're able to browse books and play them, but we're running into problems getting reporting to work correctly. We saw that the reporting endpoints for SMAPI have been deprecated, so we're attempting to follow the directions from the "Add reporting" page.
We added a reporting path at https://<our_service>/v1/reporting and added endpoints for requests to /context and /timePlayed off of that base path. We're able to hit them directly ourselves, so they're running.
We also created and hosted a manifest file at https://<our_service>/v1/files/manifest.json, which we're also able to hit directly and get the JSON file.
{
"schemaVersion": "1.0",
"endpoints": [
{
"type": "reporting",
"uri": "https://<our_service>/v1/reporting"
}
],
"strings": {
"uri": "https://<our_service>/v1/files/strings.xml",
"version": 1
}
}
After that we added our service for testing using the customsd page. We're still able to navigate the menus and play audiobooks, but Sonos appears to be sending the deprecated reporting requests to our SOAP service instead of the new reporting endpoints.
We found this question where someone appeared to be using a SMAPI implementation along with the new endpoints, but we haven't been able to figure out what we're doing differently that's causing the problem. Any ideas or suggestions would be much appreciated.
It looks like you have unsupported version numbers for the reporting endpoint and the Manifest Uri. v1 is not supported. Acceptable version numbers are v1.0, v2.0 or later. For reference, see:
The example under Add a manifest file with an endpoint in Add reporting.
POST /timePlayed for a list of features for each version.
Cloud queue base URL and API version in Play audio (cloud queue) for details about the URL and API version format.
Updated with more details:
The endpoint doesn’t have to have report at the end, it can be called anything.
The order doesn’t matter. Both /v2.1/reporting and /stuff/report/v2.3 are valid.
The reporting endpoint doesn’t have to be HTTPS, it can be insecure HTTP.
The manifest URL cannot be insecure, it must use HTTPS.
I have an error queue in ActiveMQ, which is populated by Apache Camel's onException error handler. There could be thousands of messages in this queue.
Instead of using the ActiveMQ web console, I am building a custom web admin to integrate several other statistics from other components as well. Thus, I wanted to include the statistics from ActiveMQ as well.
ActiveMQ version: 5.14.3
I have looked at Jolokia JMX API, and its operations. For instance, I have the following payload to the broker's Jolokia API endpoint:
{
"type": "exec",
"mbean": "org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=test.errors",
"operation": "browse(java.lang.String)",
"arguments": ["EXCEPTION_TYPE LIKE '%jdbc%'"]
}
The header field EXCEPTION_TYPE is already populated via Apache Camel Route. I have more than 10k messages in this queue at the moment. I made a POST request to my broker API endpoint with the payload as shown above. Although I had more than 10k messages, this request resulted in just 400 messages (due to the max page size limitation, hard coded in the source code). This means that I will not be able to get more than 400 messages at a time via Jolokia. I also tried the browseMessages() method as well. Looks like, it does the same thing, in general.
Is it possible to browse these messages (let's say if they are high in number, may be around 10k+)?
Or, is it possible to paginate them? I could not see a relevant operation method for that.
I tried to see if Hawtio did something special in retrieving all the messages. But, the result is same( with max 400 messages).
ActiveMQ web console does fetch all the messages. This probably could be because it is tightly coupled with the ActiveMQ project.
I am not restricted to just JMX/Jolokia. If these stats can be fetched via some API, its equally fine.
Any inputs would be great !
We are evaluating adoption of Spinnaker and would like to understand what API, if any, is available for creating Spinnaker resources? If I want to script/templatize the creation of my App within Spinnaker, what is the best way to do this?
As best as I can see at the moment is script the creation of your infrastructure outside of Spinnaker (e.g. CloudFormation), load that in from your AWS account, and then keep a library of pipeline JSON files that can be copy/pasted into the JSON form for pipelines that will be added afterwords.
All of the items that you can manage via the Spinnaker UI (Server Groups, Load Balancers, Security Groups, Applications, Projects, Pipelines) are scriptable via Spinnaker's REST API. The API documentation is a lacking at the moment (but coming soon, stay tuned). For now you can watch the UI's network interaction with the API via developer tools to get example payloads.
For other more static cloud infrastructure (VPCs, subnets, etc) we don't really have a story via Spinnaker's API and would recommend looking at Terraform or CloudFormation
The documentation seems to be outdated. I had a similar problem creating pipeline using pipelines-templates. It worked fine using Deck(UI) where as the pipeline json as described in https://www.spinnaker.io/reference/pipeline/templates/#pipeline-json did not work.
After creating a pipeline from pipeline-template using UI, i analysed the payload and realised the documentation is missing some of the fields in the payload. The payload given below worked fine for me. I would suggest the same, that you should analyse the payload via UI in the browser and use that as reference.
{
"schema": "v2",
"template": {
"artifactAccount": "front50ArtifactCredentials",
"reference": "spinnaker://k8s-bake-approve-deploy-s3-23-oct:latest",
"type": "front50/pipelineTemplate"
},
"application": "v2poc",
"name": "test-6",
"triggers": [],
"type": "templatedPipeline",
"stages": [],
"variables": {
"namespace": "default",
"docker_registry": "docker.io",
"k8s_account": "my-k8-account",
"helm_package_s3_object_path": "s3://spin-helm/node-1.0.0.tgz",
"helm_override_file_s3_object_path": "s3://spin-helm/values.yaml",
"docker_registry_org": "athakur",
"docker_repository": "athakur/node",
"hal_s3_account": "my-s3-account",
"hal_docker_registry_account": "my-docker-registry",
"docker_image_tag": "0.1.0",
"spinnaker_application": "v2poc"
},
"exclude": [],
"parameterConfig": [],
"notifications": []
}
I got "error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
When i try to fetch User Profile in Google+ api by https://www.googleapis.com/plus/v1/people/me URL String.If anyone have any suggestion then please tell me as soon as possible.Thanks in advance for your time.
That message implies that you haven't set up a Google APIs console project.
Create a Google APIs Console project
On the Services pane, enable all of the APIs that your project requires.
On the API Access pane, click Create an OAuth 2.0 client ID. A dialog opens. Fill in your project's information. Click Next
Choose the appropriate application type. Based on the tags you used for this post, I am guessing this is an iOS project so select Installed application.
Enter your bundle ID. You don't need to enter an App Store ID until your app is listed there.
Click Create Client ID.
You will see the client ID and client secret values. You will use these values to enable communication with your project and the Google APIs.
If you aren't already using it, see the Google+ iOS SDK and documentation for a full walk through. The task called "write moments" is similar in implementation and demonstrates how to connect to and use the Google+ REST APIs from within an iOS project that uses the SDK.
You'll need to specify the scope of plus.me to get the profile information.
I got the same error and after much hunting I found that, in my case, the Authorization header with the access token was not set. Set Authorization: "Bearer <YOUR_ACCESS_TOKEN>" in the header of the request of EVERY Google API call.
I just want to add a little information here in the rare case that someone runs into this problem.
I have an organization (ORG). I created a second channel (SC) with some playlists, that referenced videos from ORG.
I made the mistake of assuming that because ORG owned SC, that I could use the same oauth credentials from ORG to access both. I was wrong.
I switched credentials and was confused when I could access the playlists but not the videos. Again, I needed credentials for each one separately to access the resources on the respective channel.
Lame, but that was how it was.
BrettJ's answer will cover most of the bases. However, you will also get this error - even when your credentials are properly authenticated - when the scope is not properly set up. I would check the scope setting in your OAuth dance. Make sure your user is permitted to do the thing your code is trying to help them do.
On top of what BrettJ has mentioned, it is important to send the authorization header for the request done to fetch UserProfile in google+ API.
For example, Add the following header
key: Authorization
value: Bearer ya29.Ci-cA_CywoVdVG#######
For what it's worth, I also got this error when using rclone to sync files and my firewall wasn't configured to allow that traffic.