Not giving same results with dimensions and metrics from front end to API - google-analytics-api

I was able to do the following request: { "dimensions":[ { "name":"date" } { "name":"deviceCategory" } { "name":"eventName" } { "name":"customEvent:from_marketplace" } ] "metrics":[ { "name":"eventCount" } { "name":"eventCountPerUser" } ] "dateRanges":[ { "startDate":"2022-11-01" "endDate":"2022-12-12" } ] "dimensionFilter":{ "filter":{ "stringFilter":{ "matchType":"EXACT" "value":"send_offer" } "fieldName":"eventName" } } "offset":"0" "keepEmptyRows":true } when pulling data for dates before Nov 1, i get data for the event, but after Nov1, I dont get any data. If i remove the customEvent:from_marketplace and then i get data.
I usually minimized the # of dimensions in a call, but don't understand why the front end with the same dimensions and metrics provide data.

Related

GitHub Projects Beta - How to get the data from a view in the API

My company is using the new GitHub projects beta and we're really enjoying the experience, but we're facing a problem and it is how to export the data from a specific view (or even all the data) with all the custom columns that we have.
The ideal solution for us is to get this same data as JSON using the API.
Using https://api.github.com/orgs/.../issues does not work because the issues does not have the custom columns that we create inside the project, and https://api.github.com/orgs/.../projects does not have the data of the issues.
Any idea or work-around to get this data easily using APIs?
After reading the feedback post on GitHub, it's not possible to do it with API, just GraphQL, at least for now.
So my problem was solved with this useful code.
To get the first 100 project from your organization and their ID:
query{
organization(login: "MY_ORG") {
projectsNext(first: 20) {
nodes {
id
title
}
}
}
}
To get the first 100 issues and drafts from a specific project:
{
node(id: "My_Project_ID") {
... on ProjectNext {
items(first: 100, after: null) {
edges {
cursor
}
nodes {
content {
... on Issue {
title
assignees(first: 1) {
nodes {
login
}
}
milestone {
title
}
labels(first: 5) {
nodes {
name
}
}
repository{
name
}
}
}
fieldValues(first: 15) {
nodes {
value
projectField {
name
settings
}
}
}
}
}
}
}
}
Those codes can be easily tested in THIS LINK

How to redirect using F5 iRules with a variable in the URL

Hi I'm new to F5 iRule.
I'm trying to redirect
https://website1.com/userid=1234
to
https://website2.com/userid=1234
such that whatever value the userid may have will be carried over after redirection.
I'm thinking userid value should be set to a variable.
Can someone share what code to use? Thanks!
So https://website1.com/userid=8888 should go to https://website2.com/userid=8888 and so on.
You shouldn't need a variable if that pattern is consistent. A simple rule would be:
when HTTP_REQUEST {
if { [HTTP::host] eq "website1.com" } {
HTTP::redirect https://websitesite2.com[HTTP::uri]
}
}
However, if you are on v11.4+, you really should use a local traffic policy for this as it is more performant as a built-in feature of TMOS.
ltm policy sample_site_redirect {
controls { forwarding }
last-modified 2018-12-20:09:33:02
requires { http }
rules {
full_uri_redirect {
actions {
0 {
http-reply
redirect
location tcl:https://website2.com[HTTP::uri]
}
}
conditions {
0 {
http-host
host
values { website1.com }
}
}
}
}
status published
strategy first-match
}
if all traffic to the virtual server this rule or policy is attached to is intended for website1 only, you can eliminate those conditions. I didn't want to assume. If it's only the URI starting with /user= that you want to match, and redirect on, you can do that this way:
when HTTP_REQUEST {
if { ([HTTP::host] eq "website1.com") && ([string tolower [HTTP::uri]] starts_with "/user=") } {
HTTP::redirect https://website2.com[HTTP::uri]
}
}

Github list of tag and release asset urls

I'm struggling with the github graphql interface to get the data that I need. I want to get a list of asset urls for both tags and releases. It seems that some repos produce my desired result while others produce nothing.
query {
repository(owner:"erlang",name:"otp") {
releases(last:100) {
edges {
node {
url
releaseAssets(last:100) {
edges {
node {
downloadUrl
}
}
}
tag {
name
target {
... on Commit {
zipballUrl
tarballUrl
}
}
}
}
}
}
tags:refs(refPrefix:"refs/tags/", last:30) {
edges {
tag:node {
name
target {
sha:oid
commitResourcePath
... on Commit {
zipballUrl
tarballUrl
author {
name
email
date
}
}
}
}
}
}
}
}
That query, as is, produces my desired results(or at least some them) whereas owner:"spring-projects",name:"spring-framework" produces tags with no tarball. When I look at the spring-framework repo it obviously has assets for releases.
Why are they not showing in this query? When I look at git every release and tag has assets yet, even in my query, the results are hit or miss. What am I missing?
target is a git reference, in that case it can point to a Tag or a Commit object. When it points to a Commit, your query returns the expected result since ...on Commit is not empty. To get the Tag as well just try out with ...on Tag and extract the tagger or the commit it points to depending on what you want. Here is an example :
{
repository(owner: "spring-projects", name: "spring-framework") {
releases(last: 100) {
edges {
node {
url
releaseAssets(last: 100) {
edges {
node {
downloadUrl
}
}
}
tag {
...refInfo
}
}
}
}
tags: refs(refPrefix: "refs/tags/", last: 30) {
edges {
node {
...refInfo
}
}
}
}
}
fragment refInfo on Ref {
name
target {
sha: oid
commitResourcePath
__typename
... on Tag {
target {
... on Commit {
...commitInfo
}
}
tagger {
name
email
date
}
}
... on Commit {
...commitInfo
}
}
}
fragment commitInfo on Commit {
zipballUrl
tarballUrl
author {
name
email
date
}
}
Try it in the explorer
Note that in the example above, I've used fragments to reduce the query size & improve readibility
My guess is that in case the ref is pointing to a Tag object that's an annotated tag which can hold a message, a specific tagging date & tagger info. If it points to a Commit object, it's a lightweight tag which is just linking to a commit

Drools: Executing multiple rules simultaneously via REST

I am new to drools. I want to fire multiple rules simultaneously depending on the condition.
I am using batch-execution command as follows, but it gives me error : "Bad request, no commands to be executed - either wrong format or no data"
{
"batch-execution":{
"lookup":"defaultKieSession",
"commands":[
{
"insert":{
"out-identifier":"TestAdvance",
"object":{
"LoanAdvance":{
"tenure":4,
"isBlacklisted":false
}
}
}
},
{
"insert":{
"out-identifier":"TestAdvance",
"object":{
"LoanAdvance":{
"tenure":3,
"isBlacklisted":false
}
}
}
},
{
"fire-all-rules":{
}
}
]
}
}
My rule in guided decision table looks like this:
I want to make a REST request to the rule engine and get the result set as a list.
Please confirm if my JSON request is correct. Or is there any better way to achieve the same?
Any help would be appreciated.
Thanks & Regards
you are using incorrect json request format. With JSON request payload no need to use ''batch-execution", remove that. And correct JSON request will look like as:
{
"commands":[
{
"insert":{
"out-identifier":"obj",
"object":{
"example.project4_91839699.Person":{
"firstName":"abc",
"lastName":"abc",
"hourlyRate":22,
"wage":100
}
}
}
},{
"insert":{
"out-identifier":"obj2",
"object":{
"example.project4_91839699.Person":{
"firstName":"xyz",
"lastName":"xyz",
"hourlyRate":24,
"wage":100
}
}
}
}
{
"fire-all-rules":""
}
]
}

How to Map reskit with json

This is the type of JSON I am receiving, and I need to map with my model using restkit. What could be a possible solution? I have no idea about restkit.
{
-cal
{
-site{
id:""
name:""
}
-region{
id:""
name:""
}
-stats[
{
key:""
status:""
-product{
id:""
name:""
}
},{},{}
]
}
}