Hawkular resolving "Missing" triggers - hawkular

I am new to Hawkular and I have created a trigger for alert when a device did not communicate with me for a given time period (10s for testing).
"trigger": {
"id": "YYY,
"name": "My trigger",
"description": "",
"type": "GROUP",
"firingMatch": "ANY",
"autoResolve": true,
"autoResolveAlerts": true,
"enabled": true
},
"conditions": [{
"triggerMode": "FIRING",
"type": "MISSING",
"dataId": "XXX",
"interval": 10000
}]
Now I want to resolve any such alerts when the device start communicating.
Thanks

Fixed with comment by Lucas Ponce
"trigger": {
"id": "YYY",
"name": "My trigger",
"description": "",
"type": "GROUP",
"firingMatch": "ANY",
"autoResolve": true,
"autoResolveAlerts": true,
"enabled": true
},
"conditions": [{
"triggerMode": "FIRING",
"type": "MISSING",
"dataId": "XXX",
"interval": 10000
},
{
"triggerMode": "AUTORESOLVE",
"type": "AVAILABILITY",
"dataId": "Collar_UIDHEX",
"operator": "UP"
}
]

Related

Forge ARKit - Navisworks to Unity

I'm testing the Model Derivative API to translate one of my Navisworks files to SVF and then using the Forge AR|VR Toolkit to load the model in Unity. I tried before with some of the sample models in Navisworks and they loaded correctly to Unity.
When I try to load my own Navisworks file it only loads some of the components without throwing any message in the unity console, just the "loaded in: 115.9605317" one:
In the Forge Viewer, after I translated the model to SVF, it looks like this:
My manifest got these errors:
{
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6aW1tZXJzaWFfdGVzdHMvVEFJRi1TVFAtMzAtQ0RNLTMxMDAxX1RpbWVsaW5lci5ud2Q",
"derivatives": [
{
"hasThumbnail": "true",
"children": [
{
"guid": "8181cbda-7e23-4809-a45a-08d2499ce6a7",
"type": "geometry",
"role": "3d",
"name": "TAIF-STP-30-CDM-31001.nwc",
"status": "success",
"hasThumbnail": "true",
"progress": "complete",
"messages": [
{
"type": "warning",
"code": "Navisworks-MissingXref",
"message": [
"Missing external reference file: {0}",
"C:\\Users\\arq5\\Documents\\00-RVT-RECURSOS\\05-TEXTURASJPG\\HORMIGON\\hormigon ocre.jpg"
]
}
],
"viewableID": "cache",
"useAsDefault": true,
"children": [
{
"guid": "49aef14e-066f-4cfc-b5ac-9c325b4d90b6",
"type": "view",
"role": "3d",
"name": "Default",
"status": "success",
"camera": [
2217718.25,
7836792,
4384.18896484375,
2217845,
7836792,
4325.51806640625,
0.42008858919143677,
-7.63888952093339e-13,
0.9074831008911133,
3.273224115371704,
1.5807563066482544,
1,
0
],
"useAsDefault": true,
"hasThumbnail": "true",
"children": [
{
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6aW1tZXJzaWFfdGVzdHMvVEFJRi1TVFAtMzAtQ0RNLTMxMDAxX1RpbWVsaW5lci5ud2Q/output/0/0_100.png",
"role": "thumbnail",
"mime": "image/png",
"guid": "f6fa8a98-f6bc-4efd-a2a0-f3e3400f0cba",
"type": "resource",
"resolution": [
100,
100
]
},
{
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6aW1tZXJzaWFfdGVzdHMvVEFJRi1TVFAtMzAtQ0RNLTMxMDAxX1RpbWVsaW5lci5ud2Q/output/0/0_200.png",
"role": "thumbnail",
"mime": "image/png",
"guid": "128b27ba-07e8-4696-abbf-518500d081c8",
"type": "resource",
"resolution": [
200,
200
]
},
{
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6aW1tZXJzaWFfdGVzdHMvVEFJRi1TVFAtMzAtQ0RNLTMxMDAxX1RpbWVsaW5lci5ud2Q/output/0/0_400.png",
"role": "thumbnail",
"mime": "image/png",
"guid": "a47779a5-a149-4d27-b80e-84dd78bf28cb",
"type": "resource",
"resolution": [
400,
400
]
}
]
},
{
"guid": "64bc3028-731c-4ea1-9775-7a1e1a89ec82",
"type": "folder",
"name": "3D View",
"role": "viewable",
"hasThumbnail": "false",
"status": "success",
"progress": "0% complete",
"children": [
{
"guid": "1f08519e-1628-4839-af45-93b200032b26",
"type": "view",
"role": "3d",
"name": "{3D}",
"camera": [
2217922,
7836688.5,
4324.17578125,
2217995,
7836701.5,
4376.45751953125,
-0.5683003664016724,
-0.10182362794876099,
0.8164966106414795,
1,
45,
224.16700744628906,
1
],
"status": "success"
},
{
"guid": "3e259277-489f-4e98-8ed8-3b3e0a49fd75",
"type": "view",
"role": "3d",
"name": "Analytical",
"camera": [
2218373.25,
7836174,
4628.72900390625,
2218286.25,
7836905.5,
4197.9208984375,
-0.05953280255198479,
0.5012193918228149,
0.8632699251174927,
1,
45,
1036.07373046875,
1
],
"status": "success"
},
{
"guid": "ef039511-0489-446e-8c06-78bcc5ea0ab2",
"type": "view",
"role": "3d",
"name": "{3D - carmen.gg2}",
"camera": [
2217942,
7836805.5,
4334.80078125,
2217918.5,
7836822,
4309.9580078125,
-0.5310993790626526,
0.37772226333618164,
0.7584585547447205,
1,
45,
486.9418640136719,
1
],
"status": "success"
},
{
"guid": "3e93f0b5-97db-430e-9189-a120e8e402c3",
"type": "view",
"role": "3d",
"name": "{3D - carmen.gg2} Copy 1",
"camera": [
2218071.75,
7836715.5,
4252.97412109375,
2218091.5,
7836931.5,
4262.3193359375,
-0.004109169356524944,
-0.04292852059006691,
0.9990696907043457,
1,
45,
567.1892700195312,
1
],
"status": "success"
},
{
"guid": "5fa9f6b6-0847-44b6-b6d9-595c1e772d89",
"type": "view",
"role": "3d",
"name": "{3D - ricardo.navas}",
"camera": [
2217873.75,
7837036,
4360.271484375,
2217985.25,
7836975,
4267.619140625,
0.5160266160964966,
-0.2839450240135193,
0.8081409335136414,
1,
45,
835.2225952148438,
1
],
"status": "success"
},
{
"guid": "3f044262-ed05-4336-903b-43df445f204f",
"type": "view",
"role": "3d",
"name": "{3D - carmen.gg2} Copy 1 Copy 1",
"camera": [
2218292.75,
7836805.5,
4375.10009765625,
2218032.75,
7836986.5,
4314.8154296875,
-0.1535138338804245,
0.10686176270246506,
0.9823513031005859,
1,
45,
876.185791015625,
1
],
"status": "success"
},
{
"guid": "8dc04e9c-6994-48d5-be18-5efe1c48c675",
"type": "view",
"role": "3d",
"name": "{3D - jorge.mansoGPHPF}",
"camera": [
2218281,
7836987.5,
4511.279296875,
2218000.25,
7836937,
4309.6044921875,
-0.5683003664016724,
-0.10182362794876099,
0.8164966106414795,
1,
45,
713.5865478515625,
1
],
"status": "success"
}
]
},
{
"guid": "7c3a22f2-fe30-4bf9-84ef-86fe9b2f9544",
"type": "view",
"role": "3d",
"name": "Vista",
"camera": [
2218147,
7836836.5,
4338.59912109375,
2218120.75,
7836927.5,
4315.5693359375,
-0.06565795093774796,
0.22708940505981445,
0.9716581106185913,
2.7923386096954346,
0.785398006439209,
1,
0
],
"status": "success"
},
{
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6aW1tZXJzaWFfdGVzdHMvVEFJRi1TVFAtMzAtQ0RNLTMxMDAxX1RpbWVsaW5lci5ud2Q/output/0/0.svf",
"role": "graphics",
"mime": "application/autodesk-svf",
"guid": "9b21a9ef-8aef-4c8a-821d-e5c614446cae",
"type": "resource"
}
]
},
{
"urn": "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6aW1tZXJzaWFfdGVzdHMvVEFJRi1TVFAtMzAtQ0RNLTMxMDAxX1RpbWVsaW5lci5ud2Q/output/0/properties.db",
"role": "Autodesk.CloudPlatform.PropertyDatabase",
"mime": "application/autodesk-db",
"guid": "8e4c0271-e625-4b69-8662-562f34b79158",
"type": "resource",
"status": "success"
}
],
"name": "TAIF-STP-30-CDM-31001_Timeliner.nwd",
"progress": "complete",
"outputType": "svf",
"status": "success"
},
{
"status": "success",
"outputType": "arkit",
"children": [
{
"view_id": "8181cbda-7e23-4809-a45a-08d2499ce6a7",
"status": "success",
"startTime": "2021-04-09T09:43:43.372Z",
"endTime": "2021-04-09T10:40:55.076Z",
"type": "resource",
"name": "navisworks"
},
{
"view_id": "8181cbda-7e23-4809-a45a-08d2499ce6a7",
"status": "success",
"startTime": "2021-04-13T07:14:05.130Z",
"endTime": "2021-04-13T08:11:55.941Z",
"type": "resource",
"name": "taif"
}
]
}
],
"hasThumbnail": "true",
"progress": "complete",
"type": "manifest",
"region": "US",
"version": "1.0",
"status": "success"
}
What could be causing this? maybe the missing texture? the "0% complete" in the "3d View" node of the manifest?
OP EDIT:
Just found out something interesting. Most of the meshes are loaded in a random coordinate. Just the last 2 items are in 0,0,0 coordinate (first picture). Also those 2 items aren't in the correct scale.
After moving models closer to origin in Navisworks file:
I believe I've seen a similar problem in the past where the geometry coming to Unity was so far from the origin that it just didn't show up at all. You could try:
updating the original Navisworks file to move the model closer to origin, or
modifying the position of all the geometries loaded to Unity to move them closer to origin

Loopback: Relation Through - not working

So, I am stuck on an issue, that should be simple, and I am sure I am missing something obvious
I am following this documentation:
so I have 3 tables
client, team, client-team
client.json
{
"name": "client",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"name": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {
"teams": {
"type": "hasMany",
"model": "team",
"foreignKey": "teamId",
"through": "client-team"
}
},
"acls": [],
"methods": {}
}
team.json
{
"name": "team",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"type": {
"type": "string",
"required": true,
"default": "first-team"
},
"name": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {
"clients": {
"type": "hasMany",
"model": "client",
"foreignKey": "clientId",
"through": "client-team"
}
},
"acls": [],
"methods": {}
}
client-team.json
{
"name": "client-team",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"clientId": {
"type": "string",
"required": true
},
"teamId": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {
"client": {
"type": "belongsTo",
"model": "Client",
"foreignKey": "clientId"
},
"team": {
"type": "belongsTo",
"model": "Team",
"foreignKey": "teamId"
}
},
"acls": [],
"methods": {}
}
so all the relations set correctly (I think)...
then in my clients I do have 1 client
[
{
"name": "Client name",
"id": "59876185508eb519385779c6"
}
]
and in my teams I have many, but for sure this:
[
{
"type": "type",
"name": "Team name",
"id": "5ae8a37add2989a32d37f83d"
}
]
And then I go to my
localhost:3000/explorer
To POST a client-team
like this
{
"clientId": "59876185508eb519385779c6",
"teamId": "5ae8a37add2989a32d37f83d"
}
and I get the 200 response with:
{
"clientId": "59876185508eb519385779c6",
"teamId": "5ae8a37add2989a32d37f83d",
"id": "5ae961873a7e3b33f0579fc3"
}
so the connection is there....
But then, when I go to "GET client/id" and do
id: 59876185508eb519385779c6
filter: {"include":["teams"]}
this is the response
{
"name": "Chelsea FC",
"id": "59876185508eb519385779c6",
"teams": []
}
The same happens in the "GET teams/id" and I use
id: 5ae8a37add2989a32d37f83d
filter: {"include":["clients"]}
or if I go to "GET teams/{id}/clients"
and put
id: 5ae8a37add2989a32d37f83d
I get
[]
So what am I doing wrong? I am sure I am missing a stupid, obvious thing :/
using mongo if that makes any difference
There are three issues here:
You described mongodb identifiers as string, that's why you store strings in database instead of object ids. (it's not required as the datasource should understand the real type)
Your models start from lower case letter. The same should be in the relations also. (the first part of the problem, it's fixing issue with ids)
Incorrect relations for client and team models (the second part of the problem, it's fixing includes)
client-team.json
{
"name": "client-team",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"clientId": {
"type": "objectId", // !!! changed (not required)
"required": true
},
"teamId": {
"type": "objectId", // !!! changed (not required)
"required": true
}
},
"validations": [],
"relations": {
"client": {
"type": "belongsTo",
"model": "client", // !!! changed
"foreignKey": "clientId"
},
"team": {
"type": "belongsTo",
"model": "team", // !!! changed
"foreignKey": "teamId"
}
},
"acls": [],
"methods": {}
}
client.json
{
"name": "client",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"name": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {
"teams": {
"type": "hasMany",
"model": "team",
"foreignKey": "clientId", // !!! changed (we describing id of this model, not team)
"through": "client-team"
}
},
"acls": [],
"methods": {}
}
team.json
{
"name": "team",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"type": {
"type": "string",
"required": true,
"default": "first-team"
},
"name": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {
"clients": {
"type": "hasMany",
"model": "client",
"foreignKey": "teamId", // !!! changed (the same as the previous)
"through": "client-team"
}
},
"acls": [],
"methods": {}
}

Gupshup consume post to create Embedding form

im working with Gupshup and I want to add subview in my chat.
To make this I create this vars:
var url="https://api.gupshup.io/sm/api/facebook/smartmsg/form/create";
var header = {"apikey":"xxxxxxxxxxxxxxxxxxx","Content-Type": "application/x-www-form-urlencoded","Accept":"application/json"};
var param={"formJSON":{
"title": "This is a test.",
"autoClose": false,
"message": "Thank You",
"callback-url": "https://www.gupshup.io/developer/bot/Cotizador/public",
"fields": [{
"type": "fbid",
"name": "fbname",
"label": "fbName"
}, {
"type": "input",
"name": "name",
"label": "Name",
"validations": [{
"regex": "^[A-Z a-z]+$",
"msg": "Only alphabets are allowed in this field"
}, {
"regex": "^[A-Z a-z]{6,}$",
"msg": "Minimum 6 characters required"
}]
}, {
"type": "radio",
"name": "gender",
"label": "Gender",
"options": [
"Male",
"Female"
],
"validations": [{
"regex": "",
"msg": ""
}]
}, {
"type": "select",
"name": "account",
"label": "AccountType",
"options": [
"current",
"savings"
],
"validations": [{
"regex": "",
"msg": ""
}]
}, {
"type": "checkbox",
"name": "interest",
"label": "Interests",
"options": [
"Cooking",
"Reading"
],
"validations": [{
"regex": "",
"msg": ""
}]
}],
"users": [
"Testing"
]
}}
And call post with:
context.simplehttp.makePost(url,JSON.stringify(param),header,parser);
And my call back
function parser(context, event) {
context.console.log("Handler https")
var result= JSON.parse(event.getresp);
if(result=="success"){
context.sendResponse("We have successfully stored your data");
}else{
context.sendResponse("We dont shoot");
}
}
But when, make the request post, but don't show me response in chat or in callback. What im doing wrong?
Sohan from Gupshup here.
The result from the API that you are using is this:
[{
"embedlink": "https://api.gupshup.io/sm/api/facebook/smartmsg/embed/66438dde-ec76-4d6e-a0d0-8cfc0c730e57",
"expired": false,
"fb-button": {
"title": "This is a test.",
"type": "web_url",
"url": "https://api.gupshup.io/sm/api/facebook/smartmsg/embed/66438dde-ec76-4d6e-a0d0-8cfc0c730e57",
"webview_height_ratio": "tall"
},
"id": "66438dde-ec76-4d6e-a0d0-8cfc0c730e57",
"signed-for": {
"display": "Testing",
"subdisplay": "Testing"
},
"smid": "1009"
}]
Thus when you do:
var result= JSON.parse(event.getresp);
if(result=="success"){
context.sendResponse(result) will display the entire JSON that you see above. To display the 'expired' field you can use result.expired.
Check this document for more information.

what is the date format from stash api?

In the below json response, what is the date format for createdDate and updatedDate? I am not sure how to work in reverse to find what format the api is using for date. I couldn't find this any where in the documentation.
{
"size": 1,
"limit": 25,
"isLastPage": true,
"values": [
{
"id": 101,
"version": 1,
"title": "Talking Nerdy",
"description": "It’s a kludge, but put the tuple from the database in the cache.",
"state": "OPEN",
"open": true,
"closed": false,
"createdDate": 1359075920,
"updatedDate": 1359085920,
"fromRef": {
"id": "refs/heads/feature-ABC-123",
"repository": {
"slug": "my-repo",
"name": null,
"project": {
"key": "PRJ"
}
}
},
"toRef": {
"id": "refs/heads/master",
"repository": {
"slug": "my-repo",
"name": null,
"project": {
"key": "PRJ"
}
}
},
"locked": false,
"author": {
"user": {
"name": "tom",
"emailAddress": "tom#example.com",
"id": 115026,
"displayName": "Tom",
"active": true,
"slug": "tom",
"type": "NORMAL"
},
"role": "AUTHOR",
"approved": true
},
"reviewers": [
{
"user": {
"name": "jcitizen",
"emailAddress": "jane#example.com",
"id": 101,
"displayName": "Jane Citizen",
"active": true,
"slug": "jcitizen",
"type": "NORMAL"
},
"role": "REVIEWER",
"approved": true
}
],
"participants": [
{
"user": {
"name": "dick",
"emailAddress": "dick#example.com",
"id": 3083181,
"displayName": "Dick",
"active": true,
"slug": "dick",
"type": "NORMAL"
},
"role": "PARTICIPANT",
"approved": false
},
{
"user": {
"name": "harry",
"emailAddress": "harry#example.com",
"id": 99049120,
"displayName": "Harry",
"active": true,
"slug": "harry",
"type": "NORMAL"
},
"role": "PARTICIPANT",
"approved": true
}
],
"link": {
"url": "http://link/to/pullrequest",
"rel": "self"
},
"links": {
"self": [
{
"href": "http://link/to/pullrequest"
}
]
}
}
],
"start": 0
}
Just making a note that in my case, it is a UNIX timestamp, but I have to remove three trailing zeroes. E.g. the data looks like this:
"createdDate":1555621993000
If interpreted as a UNIX timestamp, that would be 09/12/51265 # 4:16am (UTC).
By removing the three trailing zeroes I get 1555621993, which is the correct time 04/18/2019 # 9:13pm (UTC)
Your mileage may vary but that was a key discovery for me :)
It looks like a UNIX timestamp.
https://en.wikipedia.org/wiki/Unix_time

What rest API can be used to get default values of fields for create issue?

I am using jira rest api's in my application.
I have found the api for getting the meta-data for creating jira issue but that API doesn't return default values of the fields for example :-
This is the request :-
http://kelpie9:8081/rest/api/latest/issue/createmeta?projectKeys=QA&issuetypeNames=Bug&expand=project.issuetypes.fields
the default value of priority field is set to "major" and the description of priority is also customized but the return from api is:-
{
"expand": "projects",
"projects": [
{
"expand": "issuetypes",
"self": "http://kelpie9:8081/rest/api/2/project/QA",
"id": "10010",
"key": "QA",
"name": "QA",
"avatarUrls": {
"16x16": "http://kelpie9:8081/secure/projectavatar?size=small&pid=10010&avatarId=10011",
"48x48": "http://kelpie9:8081/secure/projectavatar?pid=10010&avatarId=10011"
},
"issuetypes": [
{
"expand": "fields",
"self": "http://kelpie9:8081/rest/api/2/issuetype/1",
"id": 1,
"name": "Bug",
"iconUrl": "http://kelpie9:8081/images/icons/bug.gif",
"fields": {
"summary": {
"required": true,
"schema": {
"type": "string",
"system": "summary"
},
"operations": [
"set"
]
},
"timetracking": {
"required": false,
"operations": [ ]
},
"issuetype": {
"required": true,
"schema": {
"type": "issuetype",
"system": "issuetype"
},
"operations": [ ],
"allowedValues": [
{
"id": "1",
"name": "Bug",
"description": "A problem which impairs or prevents the functions of the product.",
"iconUrl": "http://kelpie9:8081/images/icons/bug.gif"
}
]
},
"priority": {
"required": false,
"schema": {
"type": "priority",
"system": "priority"
},
"name": "Priority",
"operations": [
"set"
],
"allowedValues": [
{
"self": "http://172.19.30.101:18080/rest/api/2/priority/1",
"iconUrl": "http://172.19.30.101:18080/images/icons/priority_blocker.gif",
"name": "Blocker",
"id": "1"
},
{
"self": "http://172.19.30.101:18080/rest/api/2/priority/2",
"iconUrl": "http://172.19.30.101:18080/images/icons/priority_critical.gif",
"name": "Critical",
"id": "2"
},
{
"self": "http://172.19.30.101:18080/rest/api/2/priority/3",
"iconUrl": "http://172.19.30.101:18080/images/icons/priority_major.gif",
"name": "Major",
"id": "3"
},
{
"self": "http://172.19.30.101:18080/rest/api/2/priority/4",
"iconUrl": "http://172.19.30.101:18080/images/icons/priority_minor.gif",
"name": "Minor",
"id": "4"
},
{
"self": "http://172.19.30.101:18080/rest/api/2/priority/5",
"iconUrl": "http://172.19.30.101:18080/images/icons/priority_trivial.gif",
"name": "Trivial",
"id": "5"
}
]
},
"customfield_10080": {
"required": false,
"schema": {
"type": "array",
"items": "string",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:labels",
"customId": 10080
},
"operations": [ ]
},
"customfield_10010": {
"required": false,
"schema": {
"type": "array",
"items": "string",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:labels",
"customId": 10010
},
"operations": [ ]
},
"customfield_10071": {
"required": false,
"schema": {
"type": "array",
"items": "string",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
"customId": 10071
},
"operations": [ ]
}
}
}
]
}
]
}
There is nothing like default value or description in priority field, how will I get those values?