Grafana data source variables not working in query - grafana

I want to call the JSON api with a specific body. Unfortunatelly, the plugin is not using the values of the variables set in the datascources.yaml (provisioning) file.
grant_type=password&username={{ .jsonData.user }}&password={{ .secureJsonData.password }}

Related

Flutter | Retrieve ffprobe data

I'm using flutter_ffmpeg package, specifically I'm trying to retrieve information regarding the chapter marks from a .m4b file which is an audiobook. By using this method:
_flutterFFmpeg.executeWithArguments(['-i', widget.book.path, '-print_format', 'json', '-show_chapters', '-loglevel', 'error']);
I was able to output this data as a JSON map in the console. The thing is, I need to use this data inside my application, is there a way to get access to those chapters as a variable using another approach, or maybe to access this data directly from the console log printed by the method shown earlier.

Question regarding parameter store and Cloud formation integration

I was trying this scenario but I am not able to figure out
I have a name and value in parameter store in SSM, now I am running the CF template from CLI using code pipeline, and I want the CF template take values directly from parameter store and should not prompt
on screen asking me to give the value.
I tried this but it prompt me .
AWS::SSM::Parameter::value
this is prompting when I used to upload a template in screen. how to avoid it and make the script take the value from parameter store directly
You have two choices for that:
Provide a default value for the parameter.
Use ParameterOverrides in your CodePiepline to provide the required value for the parameter.

How to pass {useMasterKey: true} to a parse-server js aggregate query?

I want to do an aggregate query using parse-server js.
Something of the style of the following code, but instead of using .find(), using .aggregate(pipeline, options).
const query = new Parse.Query("myClass");
query.find().then( // ... do something with the resulting objects)
)
According to the docs (https://parseplatform.org/Parse-SDK-JS/api/v1.11.0/Parse.Query.html#aggregate), aggregate requires the masterkey to be used. However, the options parameter of the call to .aggregate(pipeline, options) does not allow for the passing of an object that has the field to use the masterkey defined.
The workarounds found online suggest the use of Parse.Cloud.useMasterkey, which has been deprecated.
You must set the master key during the initialization of your Parse SDK. At some point in your code you probably initialize the connection with the Parse Server using a code similar to this:
Parse.serverURL = 'http://url_to_parse_server.com'
Parse.initialize('appId')
What you have to do is to pass two new parameters in the .initialize function above. The second parameter is a key to use the JS SDK, but if didn't set this key in your Parse Server then you can pass null in this parameter.
The third parameter is what you are looking for and here is where you will put the master key. Like this:
Parse.initialize('appId', null, 'master key')
After you do that all the API calls that require the master key, like aggregate will use it automatically.
There are actually two libraries at play here. Firstly, there is Parse Server - where they requirement for the use of the MasterKey is coming from.
Then there is the Parse JS SDK (to which your documentation link points) - which is the environment which Cloud Code uses to talk to Parse Server.
If you look at the source code for the aggregate function in the JS SDK, it appears that they set the MasterKey automatically: https://github.com/parse-community/Parse-SDK-JS/blob/8a69f9504f398187a856797c4b037b8eb6804dd8/src/ParseQuery.js#L763
So your query should just work, without you having to set the MasterKey explicitly from the JS SD call.

Defining a new variable in order to make a huge iteration giving me an error

I have an endpoint, you can have informaciĆ³n about products
{{URL_API}}/products/
If i perform a GET method over that endpoint i will obtain the information of every product
BUT i can also specify the product that i want to know about, i.e:
{{URL_API}}/products/9345TERFER (the last code is the id of the product, called SKU)
The problem is that if i want to make a CSV in order to update the information of different products i have to define a variable called sku in the endpoint so i will be able to pass the corresponding SKU
I want to create the variable {{sku}} but i do not understand how to do that.. i tried so many times and i failed, i've searched a lot but i do not really understand
Also, should i use ":" before the declaration of the variable? i mean:
{{URL_API}}/products/:{{sku}}
or simply:
{{URL_API}}/ns/products/{{sku}}
Can you help me?
I'm super lost :(
EDIT:
I want to perform a PUT method, i want to pass different values to the body and then.. send the request (it throws an error: 404 not found)
This is what i did:
PUT|{{URL_API}}/products/{{sku}}
body:
{
"tax_percentage":"{{tax_percentage}}",
"store_code":"{{store_code}}",
"markup_top":"{{markup_top}}",
"status":"{{status}}",
"group_prices": [
{
"group":"{{class_a}}",
"price":"{{price_a}}",
"website":"{{website_a}}"
}
]
}
CSV:
POSTMAN:
Your issue seems to be just a basic understanding of how data files work with variables in Postman, here's a simple example that will work the same way for you too.
This is a basic request I'm using to resolve the variable from the data file - It's a GET request but that doesn't matter as all we're look at here is using a data file to resolve variables. All you need to do is ensure the URL is correct and that you SAVE the request before using the runner.
Here's a simple CSV file created in a text editor. The heading sku in the name on the variable it will reference inside the Postman request. Each value under that is the value that will be used for each iteration.
In the Runner, select your Collection from the list (If you have more than one) then select the CSV file. Once imported, you will be able to see a preview of the data.
If that's correct, press the Run button. The Runner will then iterate through the file and pick up the sku value in the CSV file and use it in the request. I've expanded one of the requests so you can see that the value was used in the request.

Dafactory V2 Copy Activity Json

I am trying to copy json file from one blob to another using the datafactory copyactivity and need to Set custom value for one of the property in the dest Json when copying... so I was trying to set the jsonPathDefinition as shown in the link below to then use expression like this "#{parameters('myNumber')}" ...but seems in the C# library it is not available... is not going to be available as it available in V1 library ..is it deprecated in V2 or something that has been missed or there are other ways to achieve this in V2. Please suggest....
https://learn.microsoft.com/en-au/azure/data-factory/supported-file-formats-and-compression-codecs#json-format
In V2, there is a defect whose fix is on the way and should be available in about one week. The temporary workaround is using REST API.