vCD API request URI '/edgeGateway/{id}/action/manageExternalIpAddresses' returns RESOURCE_NOT_FOUND... Why? - vcloud-director-rest-api

Following this documentation Allocate IP Addresses to an Edge Gateway, the request always return a 404 resource not found error, meaning there is no such URI. Our vCD API supports version 9.0, which should contain that URI which was added since version 5.7.
Why can't it find that URI?
Thanks in advance.

Related

404 when requesting to issue token | ActiveCollab API

I can successfully login using this endpoint.
POST https://activecollab.com/api/v1/external/login
However when I try to issue a token I get a 404 not found. I have tried providing an app name and vendor name, I also tried omitting these fields and I still get a 404.
Are they found in our AC account somewhere? Because we cannot seem to find them.
Any assistance would be much appreciated.
Context: I have been testing through ARC (rest client) and intend to use the api in an electron desktop application. So unfortunately the feather sdk is not really useful. I have also looked into using the NodeJS sdk but unfortunately that also returns a 404.

AADSTS500112: The reply address does not match the reply address provided when requesting Authorization code

I searched through the internet yet I couldn't find this specific problem.
AADSTS500112: The reply address 'http://localhost:3000/#/training' does not match the reply address 'http://localhost:3000/' provided when requesting Authorization code.
I am getting this error and my config in the app and the redirect uri is http://localhost:3000/#/training
I have no idea why am I getting this error.
According to
Redirect URI (reply URL) restrictions | Microsoft Docs ,
When you try to use http scheme ,the port component (for example,
:5001 or :443) is ignored for the purposes of matching a redirect URI.
As a result, all of these URIs are considered equivalent.
For example , if you have more than one redirect uri for different purposes say http://localhost:5000/myapp and http://localhost:5001/myapp, both are considered equivalent and AAD may have configured for different application.
So mostly ,the redirect URL for web apps and services must begin with the https scheme . If you want to use the scheme http, you may try to use http:\\localhost or by using different names in case of multiple redirect uris present with different ports.
If still issue persists you may raise a support request.

Apache Camel Restlet - CORS Issue

This route works, and works nicely using SoapUI:
from("restlet:http://localhost:8484/restletTestService/submit?restletMethod=POST")
.routeId("myRestletSubmitRoute")
.unmarshal().json(JsonLibrary.Jackson, MyRequest.class)
.to("bean:myServiceSubmitProcessor")
.marshal().json(JsonLibrary.Jackson, MyResponse.class);
Using SoapUI, I can post jsons that conform to the structure of the MyRequest class and I get a json back with the info I think I should.
However, when I created a quick angularjs page to allow users to build a request on the fly and then 'POST' to my rest endpoint, well:
XMLHttpRequest cannot load http://localhost:8484/restletAddressService/addressPersonator/submit. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 405.
I'm pretty sure that I have to somehow set the header Access-Control-Allow-Origin to some value on the restlet URI, but I haven't a clue how to do that. I researched the documentation (http://camel.apache.org/restlet.html) and googled it, but I'm not finding anything that has helped.
Does anyone know the answer? Thanks!
UPDATE
So the answer from fiw gave me the hint I needed along with some google research on HOW a call to a rest resource determines what's allowed (plus quite a bit of good-ole-fashioned trial and error :) ). This is what wound up working:
from("restlet:http://localhost:8484/restletTestService/submit?restletMethod=POST")
.routeId("myRestletSubmitRoutePOST")
.unmarshal().json(JsonLibrary.Jackson, MyRequest.class)
.to("bean:myServiceSubmitProcessor")
.marshal().json(JsonLibrary.Jackson, MyResponse.class)
.setHeader("Access-Control-Allow-Headers", constant("Content-Type"))
.setHeader("Access-Control-Allow-Origin", constant("*"));
from("restlet:http://localhost:8484/restletTestService/submit?restletMethod=OPTIONS")
.routeId("myRestletSubmitRouteOPTIONS")
.setHeader("Access-Control-Allow-Headers", constant("Content-Type"))
.setHeader("Access-Control-Allow-Origin", constant("*"));
Thanks!
I think you need to set Access-Control-Allow-Origin as a header on the response with a value of * as you've suggested. So to do this in camel:
from("restlet:http://localhost:8484/restletTestService/submit?restletMethod=POST")
.routeId("myRestletSubmitRoute")
.unmarshal().json(JsonLibrary.Jackson, MyRequest.class)
.to("bean:myServiceSubmitProcessor")
.marshal().json(JsonLibrary.Jackson, MyResponse.class)
.setHeader("Access-Control-Allow-Origin", constant("*"));
This came from reading: enable cors on your server.

Didn't pass options request when I use angular directly upload files to s3

I am doing an angular app to upload file directly to s3 storage. The app seems work only with one issue:
When it start to upload, it will send a request with options method first, and it will fail with error as below:
In Chrome: OPTIONS https://{my-domain}.s3.amazonaws.com/ net::ERR_INSECURE_RESPONSE
In Firefox: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://{my-domain}.s3.amazonaws.com/. This can be fixed by moving the resource to the same domain or enabling CORS.
However, when I try visit in browser with https://{my-domain}.s3.amazonaws.com, it will say connection untrust, and if I choose add exception, everythings goes very well.
So, I guess it is to do with the SSL certificate which is for s3.amazonaws.com not for {my-domain}.s3.amazonaws.com. It should not because CORS, otherwise later it should still be problem.
How can I fix it? Need another SSL?
Thanks,
Ron
After days efforts, finally found out it is because I got a dot "." in the bucket name, check this for more details: Amazon S3 - HTTPS/SSL - Is it possible?

AppEngine Get HOST of incoming request

I have an API and would like to check that I only process requests from certain hosts, using self.request.host always brings back the current API host, not the requesting URL's host...any ideas?
Thanks
The Request object has a property called remote_addr that should give you IP address of the origin of the request. See the docs.
Do you mean referer?
self.request.headers.get("Referer")

Resources