I want to create a different base URI for each of the dozen customers of my API so the endpoints are the same but I can filter on customer. I think adding a template parameter to the base URI is the solution but how do I use the baseUriParameter?
I've imported a RAML spec into APIMATIC that has a baseUriParameter.
baseUri: http://{fi}.api.mycompany.com
baseUriParameters:
fi:
type: string
This template parameter gets added to each endpoint as a parameter. Here's an example endpoint.
/users:
get:
This gives an error message.
"Endpoint Users has an unused template parameter named fi."
APIMATIC has a parameter added to the endpoint.
It also means no test cases have been auto-generated.
How do I use the baseUriParameter?
Try importing your RAML API description file again. APIMATIC will use your baseUri and create template parameters now. You can checkout the Server Configuration page to see what parameters in the baseUri were recognized and set the default values for them as well.
Reference documentation for Server Configuration and template parameters in baseUri: https://docs.apimatic.io/api-editor/server-configuration/
Hope this helps!
Related
I've got two projects (backoffice and frontoffice) deployed using CloudFormation.
In the frontoffice, I import some DynamoDB table names from the backoffice stack as Environment variables for my Lambdas.
To run some acceptance tests I need to sometimes deploy the frontoffice withtout deploying the backoffice. Therefore, the frontoffice will try to do an ImportValue of an Export that doesn't exists.
Is there any pattern that would allow me to get the Frontend deployed anyway - and then handle the lack of value in my code ?
You could pass an additional Parameter to frontoffice indicating whether you are going to deploy with backoffice or not.
Based on the value of the parameter, you could use DependsOn and/or Fn::If to either import or not the DynamoDB table names.
For a fully automated solution without any extra Parameter, you would have to use custom resource. The resource would be a lambda function, which would use AWS SDK to query CloudFormation stacks and check for backoffice.
When I try to upload the zip file to an azure function app using kudu REST API, it throws an error while I try to view the c# code in Function App editor in the browser. The error is:
"Error:
Function ($Source) Error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.Source'. Microsoft.Azure.WebJobs.Host: Value cannot be null.
Parameter name: hostAccount.
Session Id: xxxxxxxxxxx
Timestamp: 2016-12-02T18:35:00.083Z"
Please note that I have automated end to end of Application Insights starting from creation of a resource group till exporting the multi-setep web test results to our Splunk - All using Powershell.
In this process of automation, I am forming a storage connection string and setting it to the app settings of the function app and then providing that key in my function.json binding.
But still I get this error.
Here is the issue I created in the Azure Function App - Git: https://github.com/Azure/azure-webjobs-sdk-script/issues/1020
The error points to missing host configuration (e.g. the host storage account).
If you're automating the creation process, you need to make sure the required environment variables are properly set. The recommended way would be to use an ARM template manage that for you.
I have some details on how you can get the ARM template for a resource (which you could use to look at the required settings for your Function App) here.
We also have some sample templates you can use linked here
I hope this helps!
I just want to use number from my server to change tile number, such as using URL http://10.59.XXX.100:8080/Map/dynamicTileOnlyNo
In SCN blog, they use /sap/fiori/employees/destinations/northwind/V3/Northwind/Northwind.svc/Employees/$count to set dynamic data
which stand for
/<fiori proxy>/<application id>/destinations/<destination name>/<path to OData service>/<OData collection>/<query string>
But I tried http://services.odata.org/Northwind/Northwind.svc/Employees/$count , returned:
Failed to update data via service /sap/fiori/realtimealerthttp://10.59.172.100:8080/Map/dynamicTileOnlyNo: HTTP request failed - 404 Not Found - sap.ushell.components.tiles.applauncherdynamic.DynamicTile
Why HCP add /sap/fiori/realtimealert in front? Should I set something in Destinations?
I tried add destinations in "Configure Portal Service ":
Name: northwind
URL: http://services.odata.org/
Still returned:
GET
https://flpportal-iXXXXXXtrial.dispatcher.hanatrial.ondemand.com/sap/fiori/alert/destinations/northwind/Northwind/Northwind.svc/Employees/$count
404 (Not Found)
Must I use odata or something?
As mentioned in the SCN blog, you need to use relative paths in the URL in combination with odata.
It also seems like your destinations are not configured properly.
Please check HCP documentation on this.
I am trying to test web service for my project. The Web service accepts a SOAP request and gives appropriate response.
In JMeter I have chosen SOAP/ XML-RPC request. It works completely fine for me and gives me correct response. However, I have more than 100s of web services in my scope of testing and I have to test them in different environments. It is very cumbersome work to change the URL value from the SOAP/ XML-RPC sample to point it to different env. Do we have something like HTTP Request Default for SOAP/XML-RPC requests?
I have also tried a bean shell sampler where I am setting the value of a variable and then retrieve it in the SOAP sampler URL parameter. However it did not work for me. Below is the code.
Bean Shell sampler code:
vars.put("baseURL","http://localhost:9191/ws/soap");
SOAP/ XML-RPS Sampler URL value:
${__BeanShell(vars.get("baseURL"))}
Any suggestions? I read in JMeter docs that this can be done via http sampler, however, I want to avoid using the same if possible.
You should avoid using SOAP/XML-RPC in favor of pure Http Sampler.
Use the "Templates..." (menu) > Building a SOAP Webservice Test Plan:
This way you can use HTTP Request Default if you want.
But note from what you describe, using a CSV Data Set Config would allow you to variabilize the URL.
Use JMeter Properties to set base url like:
in user.properties file (under /bin folder of your JMeter installation) add one line per property:
baseURL=http://localhost:9191/ws/soap
alternatively you can pass the property via -J command line key as:
jmeter -JbaseURL=http://localhost:9191/ws/soap -n -t /path/to/your/testplan.jmx -l /path/to/results.jtl
Refer the defined property in your test plan using __P() function
${__P(baseURL,)}
You can even provide the default value, i.e. if the property is not set via user.properties file or command-line argument - default value will be used:
${__P(baseURL,http://localhost:9191/ws/soap)}
See Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of setting, overriding and using them.
We have the following website structure:
content
mysite
en
home
testlevel1page
testlevel2page
Now the requirement is to map:
http://www.mysite.com/ --> /content/mysite/en/home.html
http://www.mysite.com/testlevel1page/ --> /content/mysite/en/home/testlevel1page.html
http://www.mysite.com/testlevel1page/testlevel2page/ --> /content/mysite/en/home/testlevel1page/testlevel2page.html
How can we achieve this through resource resolver?
Under the /etc/map/http directory, add a node "www.mysite.com" and give this a sling:internalRedirect property of /content/mysite/en/home.
As per the Sling documentation, this will "prefix the URI paths of the requests sent to this domain with the string" — i.e. in this case, appending "/content/my/en/home" after the domain name for any incoming requests to "www.mysite.com".
Optionally, if you place this under /etc/map.publish/http, this will only be applied to instances with a Sling run mode set to publish.
(As the rule is under a node called 'http', this won't be applied to secure requests. If you need to cater for 'https' too, you could copy the http node, or preferrably create a regex — this isn't as common a use case, but more info on the docs linked above.)