I'm tried to use this PATCH Api to rename item of "A360".
It returns 200 with DisplayName updated, but on myhub.autodesk360.com the item seems rendered with "Name" property of json object "Included".
this is the request body :
{
"jsonApi": {
"version": "1.0"
},
"data": {
"id": "urn:adsk.wipprod:dm.lineage:tMqu2aQEToa3XsRmKzTTRg",
"type": "items",
"attributes": {
"displayName": "new_item",
"name" : "new_item"
}
}
this is the response :
"data": {
"type": "items",
"id": "urn:adsk.wipprod:dm.lineage:tMqu2aQEToa3XsRmKzTTRg",
"attributes": {
"displayName": "new_item",
"createTime": "2017-10-25T09:04:35.0000000Z",
"createUserId": "QY23PAJ2YB4G",
"createUserName": "bot#autodesk360.com",
"lastModifiedTime": "2017-11-30T09:00:46.0000000Z",
"lastModifiedUserId": "AYLNNU3UK324",
"lastModifiedUserName": "Giuseppe Signorelli",
"hidden": false,
"extension": {
"type": "items:autodesk.core:File",
"version": "1.0",
"schema": {"href": "https://developer.api.autodesk.com/schema/v1/versions/items:autodesk.core:File-1.0"},
"data": {}
}
}
and object included :
"included": [ {
"type": "versions",
"id": "urn:adsk.wipprod:fs.file:vf.tMqu2aQEToa3XsRmKzTTRg?version=2",
"attributes": {
"name": "House Design.rvt",
"displayName": "House Design.rvt",
"createTime": "2017-11-09T16:50:30.0000000Z",
"createUserId": "AYLNNU3UK324",
"createUserName": "gsignorelli#tierratelematics.com",
"lastModifiedTime": "2017-11-09T16:50:34.0000000Z",
"lastModifiedUserId": "",
"lastModifiedUserName": "",
"versionNumber": 2,
"mimeType": "application/vnd.autodesk.revit",
"storageSize": 12550144,
"fileType": "rvt",
"extension": {
"type": "versions:autodesk.core:File",
"version": "1.0",
"schema": {"href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.core:File-1.0"},
"data": {}
}
}
I expected that on my client show same result that A360 shows.
If I understand correctly, you are trying to use PATCH API to rename the item name of BIM360 Docs, right? As far as I know, currently, PATCH APIs are only working on A360, they are not currently supported or encouraged for BIM 360 Docs. There might be a chance that allows for a folder rename, but it does not properly update the Docs database. So we do not recommend to use that APIs for BIM 360 Docs, and if you want to change a file name, I suggest you to upload a new version instead.
If you want to update the file name in A360, you should use PATCH API to a version, not an item. Here is what I tried, and the name of the file version is updated correctly:
PATCH API to update the name of the version, the trick thing is that you need to URL encode the version id in the endpoint, you can use any tools like https://meyerweb.com/eric/tools/dencoder/ to do that. This is different as the PATCH API to item.
Once you get the 200 status, your file name should be updated correctly in A360 as shown in the following picture:
Related
Given the following situation, where "->" is a Xref reference in either overlay or attachment mode:
TOPHOST.rvt -> LINKA.rvt -> LINKA1.rvt
I know that I can use .../:version_id/relationships/refs to retrieve references from TOPHOST.rvt, which includes the reference to LINKA.rvt.
I can repeat this with a query for LINKA.rvt, which will return the reference to LINKA1.rvt.
This way, I can gather all information necessary to create a workitem for design automation, following this guide on how to include links (see "Host RVT file with linked models").
This works for versions that are not marked as isCompositeDesign (not documented in versions/:version_id, but isCompositeDesign is a key in attributes.extension.data with boolean values). For these versions, the .../:version_id/relationships/refs API will return empty data, ie. no references!
This is a huge problem, as in active projects, items are isCompositeDesign=true most of the time.
How can I get the reference information necessary to create a Design Automation workitem in scenarios with composite designs?
Update Apr. 28, 2023
It seems related to one known issue FDM-3977. I will update here once our engineering team gets back.
====================
If your target version urn shows that it's a composite design in its attributes.extension.data.isCompositeDesign like this one, according to Why an RVT model is (sometimes) downloaded as ZIP from BIM 360, then you should get a ZIP file that contains the host and all linked RVTs while downloading the host RVT file via GET buckets/wip.dm.prod/objects/XXXX.rvt. Isn't it what you want?
{
"type": "versions",
"id": "urn:adsk.wipprod:fs.file:vf.UTLEaKw?version=4",
"attributes": {
"name": "test.rvt",
"displayName": "test.rvt",
//...
"versionNumber": 4,
"mimeType": "application/vnd.autodesk.r360",
"storageSize": 111297725,
"fileType": "rvt",
"extension": {
"type": "versions:autodesk.bim360:C4RModel",
"version": "1.1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:C4RModel-1.1.0"
},
"data": {
"modelVersion": 3,
"isCompositeDesign": true,
"mimeType": "application/vnd.autodesk.r360",
"compositeParentFile": "test.rvt",
//..
"modelType": "multiuser",
//..
"processState": "PROCESSING_COMPLETE",
"extractionState": "SUCCESS",
"splittingState": "NOT_SPLIT",
"reviewState": "NOT_IN_REVIEW",
"revisionDisplayLabel": "4",
"sourceFileName": "test.rvt",
"conformingStatus": "NONE"
}
}
},
"relationships": {
//...
"storage": {
"data": {
"type": "objects",
"id": "urn:adsk.objects:os.object:wip.dm.prod/XXXX.rvt"
},
"meta": {
"link": {
"href": "https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/XXXX.rvt"
}
}
}
}
}
I have the following adaptive card JSON code that has three Input.Toggle's. Is there a way to throw an error when the user clicks "Submit" and all three Input.Toggle's are not set to true? I saw in the Schema Explorer (Schema Explorer Input.Toggle) that they have Inherited properties called "fallback" and "requires", is that what I need? If so, how do I implement "fallback" and "requires" into this JSON code?
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"placeholder": "1.1 Business Office Coordinator - RFQ Receipt",
"type": "Input.Text",
"id": "Title"
},
{
"text": "Quote ##{body('Get_response_details')?['b194cde8837234ccc80fu5017c1b0f869']} ",
"type": "TextBlock",
"id": "textBlock1"
},
{
"type": "Input.Toggle",
"title": "Customer Acknowledgement",
"valueOn": "custYes",
"valueOff": "custNo",
"id": "Customer"
},
{
"type": "Input.Toggle",
"title": "Create RFQ Log Number and Enter Information into RFQ Log",
"valueOn": "RFQYes",
"valueOff": "RFQNo",
"id": "RFQ"
},
{
"type": "Input.Toggle",
"title": "Populate Quote Folder with Customer Data",
"valueOn": "PopulateYes",
"valueOff": "PopulateNo",
"id": "Populate"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"id": "9876543210"
}
}
]
}
this is part of input validation which as of today is not available yet.
I'm afraid what you're asking for is not possible right now but will hopefully be soon.
You can follow the feature request here: https://portal.productboard.com/adaptivecards/1-adaptive-cards-features/c/21-input-validation-and-evolution , add your own vote to it aswell if you want to.
Depending on where you use the card however, you can get this working. In MS Teams you could verify the card submission in your own code and return an error. Its not client side but that way you can still do the check.
We are trying to retrieve the description or custom attribute field as shown in BIM360 Docs using Autodesk Forge API requests/commands.
We have tried the following requests to retrieve information about a specific file:
https://forge.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-items-item_id-GET/
https://forge.autodesk.com/en/docs/data/v2/reference/http/ListItems/
We get a lot of information/data about our files, but we cannot see the Description field neither a Custom Attribute in the responses that we are getting.
"data": {
"type": "versions",
"id": "urn:adsk.wipprod:fs.file:vf.WKuhlYuyR8uK2WT8HE1bCQ?version=20",
"attributes": {
"name": "TESTING",
"displayName": "TESTING",
"createTime": "2019-07-29T09:37:33.0000000Z",
"createUserId": "*****",
"createUserName": "TESTING",
"lastModifiedTime": "2019-08-05T08:27:10.0000000Z",
"lastModifiedUserId": "*****",
"lastModifiedUserName": "TESTING",
"versionNumber": 20,
"storageSize": 27020,
"fileType": "xlsx",
"extension": {
"type": "versions:autodesk.bim360:File",
"version": "1.0",
"schema": {
"href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:File-1.0"
},
"data": {
"processState": "PROCESSING_COMPLETE",
"extractionState": "UNSUPPORTED",
"splittingState": "NOT_SPLIT",
"revisionDisplayLabel": "20",
"sourceFileName": "TESTING"
}
}
},
...
}
Among all of these fields, we expected the fields "Description" or "Custom Attributes" to appear as well (As they are shown in BIM360 DOCS). ¿Is it possible to retrive these fields using API requests?
At the moment it is not possible to retrieve Custom Attribute information from BIM 360 Docs, But a new API is under development and in Private Beta testing at the moment to get this information back, Please check back with us in a near future since this will become available soon. Thank you for understanding.
I want to create new alerts(High CPU,RAM) for all AppServicePlans in a given subscription. I could not find Powershell commands to create new alerts. Is there a way we can create these alerts for all appserviceplans with a single script? May be using ARM template?
Sorry for pasting a direct answer, but I cannot yet comment. You get the error because in the documentation for Add-AzMetricAlertruleV2 it states: "$act is the output of New-AzActionGroup cmdlet". Meaning you need to use for example:
$act = New-AzActionGroup -ActionGroupId "testActionGroup"
After that you need to add it in the parameter -ActionGroup $act for it to work.
If you look at Resource Explorer and navigate to a manually created (near-realtime) alert, you should see the "critera" object defined like below. Here is a full example of a resource that seems to be working. Create some variables for each of your values:
{
"type": "Microsoft.Insights/metricAlerts",
"apiVersion": "2018-03-01",
"name": "[variables('alertName')]",
"location": "global",
"dependsOn": [],
"tags": {
"[concat('hidden-link:', variables('applicationInsightsResourceId'))]": "Resource",
"[concat('hidden-link:', variables('webtestResourceId'))]": "Resource"
},
"properties": {
"description": "[concat('Alert for ', parameters('availibilityTestName'))]",
"severity": 4,
"enabled": true,
"scopes": [
"[variables('webtestResourceId')]",
"[variables('applicationInsightsResourceId')]"
],
"evaluationFrequency": "PT5M",
"windowSize": "PT15M",
"criteria": {
"odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
"webTestId": "[variables('webtestResourceId')]",
"componentId": "[variables('applicationInsightsResourceId')]",
"failedLocationCount": 3
},
"actions": [
{
"actionGroupId": "[resourceId('microsoft.insights/actiongroups', 'webhook')]",
"webHookProperties": {
// Some properties to send to webhook
}
}
]
}
}
is it possible to check, in an ARM Template, if the name for my Virtual Machine already exists?
I am developing a Solution Template for the Azure Marketplace. Maybe it is possible to set a paramter in the UiDefinition uniqe?
The goal is to reproduce this green Hook
A couple notes...
VM Names only need to be unique within a resourceGroup, not within the subscription
Solution Templates must be deployed to empty resourceGroups, so collisions with existing resources aren't possible
For solution templates the preference is that you simply name the VMs for the user, rather than asking - use something that is appropriate for the workload (e.g. jumpbox) - not all solutions do this but we're trying to improve that experience
Given that it's not likely we'll ever build a control that checks for naming collisions on resources without globally unique constraints.
That help?
This looks impossible, according to the documentation.
There are no validation scenarious.
I assume that you should be using the Microsoft.Common.TextBox UI element in your createUiDefinition.json.
I have tried to reproduce a green check by creating a simple createUiDefinition.json as below with a Microsoft.Common.TextBox UI element as shown below.
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json",
"handler": "Microsoft.Compute.MultiVm",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{
"name": "textBoxA",
"type": "Microsoft.Common.TextBox",
"label": "VM Name",
"defaultValue": "",
"toolTip": "Please enter a VM name",
"constraints": {
"required": true
},
"visible": true
}
],
"steps": [],
"outputs": {}
}
}
I am able to reproduce the green check beside the VM Name textbox as shown below:
However, this green check DOES NOT imply the VM Name is Available.
This is because based on my testing, even if I use an existing VM Name in the same subscription, it is still showing the green check.
Based on the official documented constraints that are supported by the Microsoft.Common.TextBox UI element, it DOES NOT VALIDATE Name Availability.
Hope this helps!
While bmoore's point is correct that it's unlikely you would ever need this for a VM (nor is there an API for it), there are other compute resources that do have global naming requirements.
As of 2022 this concept is possible now with the use of the ArmApiControl UI element. It allows you to call ARM apis as part of validation in the createUiDefinition.json. Here is an example using the check name API for an Azure App service.
{
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
"handler": "Microsoft.Azure.CreateUIDef",
"version": "0.1.2-preview",
"parameters": {
"basics": [
{}
],
"steps": [
{
"name": "domain",
"label": "Domain Names",
"elements": [
{
"name": "domainInfo",
"type": "Microsoft.Common.InfoBox",
"visible": true,
"options": {
"icon": "Info",
"text": "Pick the domain name that you want to use for your app."
}
},
{
"name": "appServiceAvailabilityApi",
"type": "Microsoft.Solutions.ArmApiControl",
"request": {
"method": "POST",
"path": "[concat(subscription().id, '/providers/Microsoft.Web/checknameavailability?api-version=2021-02-01')]",
"body": "[parse(concat('{\"name\":\"', concat('', steps('domain').domainName), '\", \"type\": \"Microsoft.Web/sites\"}'))]"
}
},
{
"name": "domainName",
"type": "Microsoft.Common.TextBox",
"label": "Domain Name Word",
"toolTip": "The name of your app service",
"placeholder": "yourcompanyname",
"constraints": {
"validations": [
{
"regex": "^[a-zA-Z0-9]{4,30}$",
"message": "Alphanumeric, between 4 and 30 characters."
},
{
"isValid": "[not(equals(steps('domain').appServiceAvailabilityApi.nameAvailable, false))]",
"message": "[concat('Error with the url: ', steps('domain').domainName, '. Reason: ', steps('domain').appServiceAvailabilityApi.reason)]"
},
{
"isValid": "[greater(length(steps('domain').domainName), 4)]",
"message": "The unique domain suffix should be longer than 4 characters."
},
{
"isValid": "[less(length(steps('domain').domainName), 30)]",
"message": "The unique domain suffix should be shorter than 30 characters."
}
]
}
},
{
"name": "section1",
"type": "Microsoft.Common.Section",
"label": "URLs to be created:",
"elements": [
{
"name": "domainExamplePortal",
"type": "Microsoft.Common.TextBlock",
"visible": true,
"options": {
"text": "[concat('https://', steps('domain').domainName, '.azurewebsites.net - The main app service URL')]"
}
}
],
"visible": true
}
]
}
],
"outputs": {
"desiredDomainName": "[steps('domain').domainName]"
}
}
}
You can copy the above code and test it in the createUiDefinition.json sandbox azure provides.