SoftLayer API to get the ID for OS partition templates - templates

I've been searching SLAPI to order a baremetal servers with partition template for OS.
After I read some articles to order the RAID and configure the partition template data, I found that the ID or description of the OS is required to get the template data.
so, I've tried to get these information of OS with SLAPIs but I couldn't.
For the 'CentOS 7.x (64 bit)', the OS description should be 'linux' but I don't know how to get it with the OS item ID is 5920 and the item price ID is 44988 in dal03.
Here is referred article: Configuring Softlayer Disk Partitions at Order Time
and the response from calling [services/SoftLayer_Hardware_Component_Partition_OperatingSystem]/getAllobjects
[{
"description": "linux",
"id": 1,
"notes": "All flavors"
}, {
"description": "windows",
"id": 2,
"notes": "All RH-based or closely related"
}, {
"description": "freebsd",
"id": 3,
"notes": "FreeBSD, etc.."
}]
and the response of item price (44988) is :
{
"currentPriceFlag": null,
"hourlyRecurringFee": "0",
"id": 44988,
"itemId": 5920,
"laborFee": "0",
"locationGroupId": null,
"onSaleFlag": null,
"oneTimeFee": "0",
"quantity": null,
"recurringFee": "0",
"setupFee": "0",
"sort": 0,
"item": {
"capacity": "0",
"description": "CentOS 7.x (64 bit)",
"id": 5920,
"itemTaxCategoryId": 166,
"keyName": "OS_CENTOS_7_X_64_BIT",
"softwareDescriptionId": 1400,
"units": "N/A",
"upgradeItemId": null,
"itemCategory": {
"categoryCode": "os",
"id": 12,
"name": "Operating System",
"quantityLimit": 0
},
"softwareDescription": {
"controlPanel": 0,
"id": 1400,
"licenseTermValue": null,
"longDescription": "CentOS / CentOS / 7.0-64",
"manufacturer": "CentOS",
"name": "CentOS",
"operatingSystem": 1,
"referenceCode": "CENTOS_7_64",
"upgradeSoftwareDescriptionId": null,
"upgradeSwDescId": null,
"version": "7.0-64",
"virtualLicense": 0,
"virtualizationPlatform": 0,
"requiredUser": "root"
}
}
}

That insformation is not in the API, you have to use your own code in order to pick out the correct template, for that you could use the description of the item e.g.
if the item description contains CentOS or Ubuntu or RedHat use linux
if the item description contains Windows use windows
if the item description contains FreeBSD use freebsd
Regards

Related

CVAT coco annotation json - iscrowd option

when outputting coco annotation json from CVAT, it is found that there is an attribute call 'iscrowd', but I cant seem to figure out how it is adjusted or annotated on CVAT to change the value to 1, under the scenario where the object is literally crowded. Can any one shed some lights?
{
"annotations": [
{
"bbox": [
762.703125,
176.583984375,
425.27301025390625,
413.6938171386719
],
"id": 1,
"area": 175932.81493799202,
"iscrowd": 0,
"segmentation": [
[
762.703125,
176.583984375,
1187.9761352539062,
176.583984375,
1187.9761352539062,
590.2778015136719,
762.703125,
590.2778015136719
]
],
"category_id": 1,
"image_id": 0
}
],
"licenses": [
{
"name": "",
"id": 0,
"url": ""
}
],
"info": {
"version": "",
"description": "",
"date_created": "",
"contributor": "",
"year": "",
"url": ""
},
"images": [
{
"file_name": "10.jpg",
"id": 0,
"license": 0,
"flickr_url": "",
"height": 864,
"coco_url": "",
"date_captured": 0,
"width": 1536
}
],
"categories": [
{
"name": "test",
"supercategory": "",
"id": 1
}
]
}
On the other hand when adding an attribute to a label (Simple Check Box Attribute), it doesn't seem to be properly outputted in COCO json. Am I doing something Wrong?
It might be worth taking a look at the integration between FiftyOne, an open source dataset exploration tool, and CVAT which provides a flexible API to upload and define how to annotate new and existing labels. This post pretty much walks through the workflow you are looking for.
You can load COCO formatted datasets into FiftyOne:
import fiftyone as fo
dataset = fo.Dataset.from_dir(
dataset_dir="/path/to/dataset",
dataset_type=fo.types.COCODetectionDataset,
label_field="ground_truth",
)
Send the dataset (or a subset of it) to CVAT for annotation:
dataset.annotate("annot_run_1", label_field="ground_truth", backend="cvat")
It will automatically upload the annotations to CVAT, including formatting all attributes on your labels (like iscrowd) for you to edit in CVAT. The API for this integration also lets you specify new attributes and how they are to be annotated.
When you're done annotating, you can load it back into FiftyOne and write it back to disk in the COCO format.
# Load from CVAT
dataset.load_annotations("annot_run_1")
# Write back to disk
dataset.export(
export_dir="/path/to/label.json",
dataset_type=fo.types.COCODetectionDataset,
label_field="ground_truth",
)

Dynamically add ordered number to each object in Paginated response from Django Rest

I'm currently getting a standard paginated response using Django REST framework, however I need to add a number to each object response in the order it is retrieved. 1,2,3,4,5 etc. It must be calculated each time dynamically if new results are added and retrieved by the user. It would go from this:
{
"next": "http://localhost:8000/api/home/?page=2",
"previous": null,
"count": 105,
"results": [
{
"title": "example1",
"description": "foobar1",
},
{
"title": "example2",
"description": "",
},
...
]
to looking like this:
{
"next": "http://localhost:8000/api/home/?page=2",
"previous": null,
"count": 105,
"results": [
{
"key": 1,
"title": "example1",
"description": "foobar1",
},
{
"key": 2,
"title": "example2",
"description": "",
},
...
]
This would also include the next page in the paginated response, e.g. 21, 22, 23, 24. If a user then refreshes the page and new data is found and retrieved it would recalculate and add key numbers again. How would one go about this?
Thanks!

How do you GET a Project's image in BIM 360 using Postman?

I am able to create or update an existing Project's image on BIM 360 using Postman but is there any way to get GET the information regarding it? Using the GET method, there is no information regarding images as shown below.
URL:
https://developer.api.autodesk.com/hq/v1/accounts/{{Account_Id}}/projects/{{Project_Id}}
HTTP method:
GET
Result:
{
"id": "**************************",
"account_id": "**************************",
"name": "My Project(2)",
"start_date": "2018-11-06",
"end_date": "2018-12-06",
"value": null,
"currency": "USD",
"status": "active",
"job_number": null,
"address_line_1": null,
"address_line_2": null,
"city": null,
"state_or_province": null,
"postal_code": null,
"country": "United States",
"business_unit_id": null,
"created_at": "2019-01-14T15:31:25.950Z",
"updated_at": "2019-01-18T09:35:27.071Z",
"project_type": "Demonstration Project",
"timezone": null,
"language": "en",
"construction_type": null,
"contract_type": null,
"last_sign_in": "2019-01-15T14:59:08.000Z",
"service_types": "doc_manager,insight,admin"
}
Also using a GET method on the following URL doesn't exist.
https://developer.api.autodesk.com/hq/v1/accounts/{{Account_Id}}/projects/{{Project_Id}}/image
Unfortunately, we provide the PATCH API to upload/update the image of a BIM360 project, but there is not an API to fetch Project Image, this is already tracked internally, I will add more comments for this request.

How to list buildpacks on cloudfoundry

I know that we can deploy our applications through pivotal cloud foundry.We can push build packs that provide framework and run time support for your applications.I want to create a Jenkins job to list all the build packs available on my cloud foundry.How this can be achieved.Thanxx
You can use the CLI to list the buildpacks: cf buildpacks or you can just query the cloud controller directly (api.system domain) by GETing /v2/buildpacks, however you need to be an authenticated user to make this request.
Even more you can launch curl directly from cf client command:
# cf curl /v2/buildpacks
{
"total_results": 9,
"total_pages": 1,
"prev_url": null,
"next_url": null,
"resources": [
{
"metadata": {
"guid": "b7890a54-f7c5-4973-a3da-e1a48ba6811d",
"url": "/v2/buildpacks/b7890a54-f7c5-4973-a3da-e1a48ba6811d",
"created_at": "2017-05-24T12:53:27Z",
"updated_at": "2017-05-24T12:53:27Z"
},
"entity": {
"name": "binary_buildpack",
"position": 1,
"enabled": true,
"locked": false,
"filename": "binary_buildpack-cached-v1.0.11.zip"
}
},
...
"metadata": {
"guid": "95e3f977-09d1-4b96-96bc-e34125e3b3a2",
"url": "/v2/buildpacks/95e3f977-09d1-4b96-96bc-e34125e3b3a2",
"created_at": "2017-05-24T12:54:03Z",
"updated_at": "2017-05-24T12:54:04Z"
},
"entity": {
"name": "staticfile_buildpack",
"position": 8,
"enabled": true,
"locked": false,
"filename": "staticfile_buildpack-cached-v1.4.5.zip"
}
}
]
}
Doc https://apidocs.cloudfoundry.org/258/

redmine create issue assigned_to_id does not work

i am trying to use the redmine API to create new issue via code,
just to test it i am trying to send the data to the API using postman.
i have used amazon to host it.
I try send json via post method. (using postman -plugin for chrome)
url:- http://{user_name}:{password}#xxxredmine_urlxxx/issues.json
type:- POST
Body:-
{
"issue": {
"project_id": 1,
"subject": "New ticket via API",
"description": "API test 27\/6",
"status_id": 1,
"priority_id": 3,
"assigned_to_id": 5
}
}
it creates a ticket successfully but never sets an assignee
{
"issue": {
"id": 61,
"project": {
"id": 1,
"name": "EasySoft"
},
"tracker": {
"id": 1,
"name": "Bug"
},
"status": {
"id": 1,
"name": "New"
},
"priority": {
"id": 3,
"name": "High"
},
"author": {
"id": 1,
"name": "UserName LastName Admin"
},
"subject": "New ticket via API",
"description": "API test 27/6",
"start_date": "2016-06-27",
"done_ratio": 0,
"custom_fields": [
{
"id": 2,
"name": "Customer name",
"value": ""
}
],
"created_on": "2016-06-27T09:37:58Z",
"updated_on": "2016-06-27T09:37:58Z"
}
}
i have tried changing assigned_to_id to
"assigned_to":{"id":5}
Thank you in advance.
This is an old question but potentially still useful to answer... are you certain that the user you are attempting to set as the assignee is in an assignable role on that specific project? Unfortunately, the Redmine REST API will respond with a 200 OK even if you give it a non-assignable user, so there's no indication that it was unable to successfully set the user as the assignee.