I'm querying AWS Config using Athena to get all the applications installed on managed instances.
The installed applications are in SSM Inventory.
I have this query:
WITH dataset AS (
SELECT
"configurationItem"."resourceid" "ResourceId",
"json_extract"("configurationItem"."configuration", '$.aws:application.content') "apps"
FROM
config.aws_config_configuration_snapshot
CROSS JOIN UNNEST("configurationitems") t (configurationItem)
WHERE (("dt" = 'latest') AND ("configurationItem"."resourcetype" = 'AWS::SSM::ManagedInstanceInventory'))
)
SELECT
ResourceId, apps
FROM dataset
This gives me something like this:
What I'm trying to do here is to split the column "apps" into multiple columns.
Here is an example of an item of "apps":
{
"amazon ssm agent": {
"packageid": "{33ecc234-8e53-4683-ae9e-42366ffd29bd}",
"name": "Amazon SSM Agent",
"publisher": "Amazon Web Services",
"version": "3.1.1927.0",
"architecture": "i386"
},
"aws-cfn-bootstrap": {
"packageid": "{bc60d8d6-ec53-4ed1-9ca4-c4601c97f724}",
"name": "aws-cfn-bootstrap",
"publisher": "Amazon Web Services",
"version": "2.0.15",
"architecture": "i386"
},
"microsoft visual c++ 2008 redistributable - x64 9.0.30729.6161": {
"installedtime": "2022-10-11T00:00:00Z",
"packageid": "{5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4}",
"name": "Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161",
"publisher": "Microsoft Corporation",
"version": "9.0.30729.6161",
"architecture": "x86_64"
}
}
I want to get for each ResourceId, all the columns inside apps, meaning somethink like this:
ResourceId | name | packageid | publisher | version | architecture | installedtime
I tried many functions to do so but I can find how to convert a map of maps to a simple array in Pesto.
Thank you,
Related
I'm looking for advice on the best way to organize the way I manage data in an angular 14 application. Basically, this web application consist in groups of forms through several pages that are nested in three levels of information as follows :
Parent form : Intervention x (Application can have several interventions as this one)
Child form : Enterprise y (One intervention can have several enterprises)
Child form : Employee z (several individuals associated to an enterprise)
Each form information is collected using reactive forms through different pages that are shown in the screen thanks to router-navigation module of Angular.
What have I tried so far:
I started developing the application from the individual level, and then, I share the information between the pages using a service called on the component of each page. Later, I created the enterprise forms and another service specifically called to store their information.
In order to make the data persistent, I am currently using json-server to store the data in a .json file and simulate an API behavior. This allows me to do Http calls from the services in order to get, put and post the Data in the .json.
Is there a better way?
Right now I'm developing the intervention form, it is becoming very hard to maintain the child forms and I guess there is a better way to manage data for this kind of applications.
Here an example of the .json server structure :
{"interventions":
[{
"id": 1,
"user": "",
"email": "",
"enterprises":
[{
"id": 1,
"name": "",
"address": "",
"employees":
[{
"id": 1,
"name": "",
"email": ""
},
{
"id": 2,
"user": "",
"email": ""
}]
},
{
"id": 2,
"user": "",
"email": "",
"address": "yyy",
}]
},
{
"id": 2,
"user": "",
"email": "",
"address": "yyy",
}]
}
Hope this question is clear, I can provide more details if needed.
Thank you in advance.
Is there a way to pull the configurations of other portlets or categories within a single angular portlet? I was hoping to use a single system configuration in multiple portlets. In the feature > configuration json, I have added this code that I was hoping would work but I can't get it back into the portlet.
"system": {
"category": "related.configuration",
"name": "Related Configurations",
"fields": {
"development": {
"type": "boolean",
"name": "Developer Mode",
"description": "Should the portlets be set to developer mode?",
"default": false
}
}
},
There is no way to do this with this configuration setup. The configurations are for :
Individual portlets
All portlets of that type
I am working on an ARM template that deploys an entire infrastructure from scratch:
The resource group
App Service plans
Application Insights
an so forth...
At some point I get to the part where I write the scripts for deploying my App Service (for hosting and deploying my web app later on) to my resource group. Prior to that I have my BingMaps API deployed in the same script.
I am stuck at the part where I am setting the Application Settings for my web app:
"type": "Microsoft.Web/sites",
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "SomeKey",
"value": "SomeValue"
}, //rest of the code omitted
I would like to know how could I retrieve my BING MAPS query key within an ARM template?
I have tried, and have a feeling that this might be close to it, something like:
"value": "[reference(resourceId('Microsoft.BingMaps/mapApis', variables('bingMapsName')), '2016-08-18').queryKey]"
Anybody who has done this before? Many thanks in advance! Cheers
If you want to access query key in your ARM template for your web app setting, I would suggest you to use something like below:
{
"name": "appsettings",
"type": "config",
"apiVersion": "2015-08-01",
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('webSiteName'))]"
],
"tags": {
"displayName": "WebAppSettings"
},
"properties": {
"key1": "[parameter('AppSetting_Key1_Value')]",
"key2": "value2"
}
}
and then in your template.Parmeter.jso file , you can declare the key AppSetting_Key1_Value with the value of your Bing maps query key.
Specify the Parameter Value
After the Parameter has been added to the ARM Template and it’s being used to populate an Application Setting, the final step is to define the Parameter value within the ARM Templates Parameter file used for deployments. In the Azure Resource Group project template in Visual Studio the Parameters file for the default deployment is the file that ends with “.parameters.json”.
Here’s a screenshot of the “WebSite.parameters.json” file created in the previous articles in this series with the “AppSetting_Key1_Value” Parameter set to a value:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"hostingPlanName": {
"value": "WebApp1HostingPlan"
},
"WebApplication1PackageFolder": {
"value": "WebApplication1"
},
"WebApplication1PackageFileName": {
"value": "package.zip"
},
"WebApp_ConnString1": {
"value": "Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;"
},
"AppSetting_Key1_Value": {
"value": "Template Value 1"
}
}
}
for security complaint solution , you can move all your secure key and connection string to Azure key vault if you are not comfortable to have keys in param file.
This should work. Hope it helps.
We have a requirement from one of our clients to access the project files that are stored in the BIM360 Design (old Collaboration for Revit - C4R). I can not find any information in the developer pages of the Forge APIs that points to this location. I assume such an API is not part of Forge, but we were wondering if there is any other API that can provide those files.
The exact requirements are:
Constantly monitor for changes on the files located there.
When changes occur, retrieve and backup all those files to a local machine.
The question is, how, if possible, can we access the project files located at the BIM360 Design cloud?
UPDATE (10/04/2018)
We have found these commands - specifically PublishModel and GetPublishModelJob. This does something, we can at the very least prompt the publication on demand, without the need for Revit. It is not clear to me when the items:autodesk.bim360:C4RModel pseudo-file is created. On top of that, the API does not appear to be able to receive a prefered output folder, which makes it really cumbersome to work for the intended purpose of backing up the information inside BIM360 Design.
UPDATE (25/04/2018)
We have tried using both commands (PublishJob and GetPublishModelJob). We have impersonated a Project Admin (via the x-user-id) but Forge is returning a 401 error (which is not even documented). The following (with a redacted documentID) is what we have tried:
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "commands",
"attributes": {
"extension": {
"type": "commands:autodesk.bim360:C4RModelGetPublishJob",
"version": "1.0.0"
}
},
"relationships": {
"resources": {
"data": [ { "type": "items", "id": "<document_id>" } ]
}
}
}
}
And this is Forge's response:
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "a4547153-1fd4-4710-b0d1-a7184d9e7e22",
"status": "401",
"code": "C4R",
"detail": "Failed to get publish model job"
}
]
}
Any thoughts?
After discussing with #tfrascaroli in Forge Help channel, we found the root cause of this error is caused by the incorrect value of x-user-id, so he didn't have the right permission to push the latest version of the C4R model to BIM360 docs.
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "a4547153-1fd4-4710-b0d1-a7184d9e7e22",
"status": "401",
"code": "C4R",
"detail": "Failed to get publish model job"
}
]
}
The x-user-id is not a GUID and not the id we saw in the response of GET users or GET users/:user_id, it should be the value of the uid. After replacing the x-user-id value by the uid, the error doesn't show up again.
[
{
"id": "a75e8769-621e-40b6-a524-0cffdd2f784e", //!<<< We didn't use it for `x-user-id`
"account_id": "9dbb160e-b904-458b-bc5c-ed184687592d",
"status": "active",
"role": "account_admin",
"company_id": "28e4e819-8ab2-432c-b3fb-3a94b53a91cd",
"company_name": "Autodesk",
"last_sign_in": "2016-04-05T07:27:20.858Z",
"email": "john.smith#mail.com",
"name": "John Smith",
"nickname": "Johnny",
"first_name": "John",
"last_name": "Smith",
"uid": "L9EBJKCGCXBB", //!<<<<< Here is the value for the x-user-id
"image_url": "http://static-dc.autodesk.net/etc/designs/v201412151200/autodesk/adsk-design/images/autodesk_header_logo_140x23.png",
"address_line_1": "The Fifth Avenue",
"address_line_2": "#301",
"city": "New York",
"postal_code": "10011",
"state_or_province": "New York",
"country": "United States",
"phone": "(634)329-2353",
"company": "Autodesk",
"job_title": "Software Developer",
"industry": "IT",
"about_me": "Nothing here",
"created_at": "2015-06-26T14:47:39.458Z",
"updated_at": "2016-04-07T07:15:29.261Z"
}
]
Do you have an access right to the workshared Revit file? Publish command is to publish workshared central model in the cloud to Docs. To use it, you need an access to Revit model in the central in the cloud. Forge Publish command does the same thing as publish command in Revit desktop. You need the same access right. To use cloud workshared feature, first you need to have Design license assigned to you, then you also need to be a member a Revit project. Being invited to Docs is not enough.
(As C4R/Design was merged to Docs recently, this C4R specific license part was intentionally kept the same as previous licensing. We also have Team for earlier versions. It makes it a bit complicated. I hope it will be easier as we move forward in future.)
I'm trying to query Box API to identify if a user has a free or a paid account. So far I was able to query:
https://api.box.com/2.0/users/me?fields=enterprise
and I checked that if a user have a free account the attribute "enterprise" is null. But the problem is I can't distinguish between a paid account and a developer account because the have the same info on enterprise object:
{
"type": "user",
"id": "123",
"enterprise": {
"type": "enterprise",
"id": "456",
"name": "..."
}
}
Is there a way to identify theses 3 types of account (free, paid and developer)?
Currently you can only check whether or not the user has an enterprise by calling the GET /users/me endpoint.
{
"type": "user",
"id": "123",
"enterprise": {
"type": "enterprise",
"id": "456",
"name": "..."
}
}
and checking to see if the enterprise attribute is null to distinguish between a personal and enterprise user.