How can I get a list of all the projects in our Rally instance via the REST API? - rally

How can I query our Rally instance for all of our available projects?
Output from REST call https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Name,Projects&pretty=true
...
"Workspaces": [
{
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/workspace/1376977801.js",
"_objectVersion": "10",
"_refObjectName": "Workspace 1",
"Name": "Workspace 1",
"Projects": [ {
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/project/2510231094.js",
"_objectVersion": "3",
"_refObjectName": "Layout",
"Name": "Layout",
"_type": "Project"
}],
"_type": "Workspace"
},
{
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/workspace/1462743357.js",
"_objectVersion": "8",
"_refObjectName": "Bugzilla Workspace",
"Name": "Bugzilla Workspace",
"Projects": [ {
"_rallyAPIMajor": "1",
"_rallyAPIMinor": "29",
"_ref": "https://rally1.rallydev.com/slm/webservice/1.29/project/2510231094.js",
"_objectVersion": "3",
"_refObjectName": "Layout",
"Name": "Layout",
"_type": "Project"
}],
"_type": "Workspace"
},
...
Update #2
The user account being used for the API calls is indeed a subscription admin. I tried a few things with our admin to try and narrow down the problem as to what is occurring and noted a few things:
The projects that are getting returned in the call, are not projects that the api user is a team member of
When we assigned a story to the api user and refreshed the result of the REST call, the projects that were returned in every workspace were identical and seemed to be all of the projects from the given workspace of the project that we assigned the story from. For example, I've pasted the top part of a return: http://khayes.privatepaste.com/cfc730dcf8
It appears this particular REST call has a bug in it.

This should be possible by querying on type 'Subscription'. Make sure you include Workspaces and Projects (and any other data you might want like Name) in your Fetch.
https://rally1.rallydev.com/slm/webservice/1.29/subscription.js?fetch=Workspaces,Projects,Name&pretty=true
The results should look something like this:
{
_ref: "/subscription/1.js",
_refObjectName: "My Subscription",
Workspaces: [
_ref: "/workspace/2.js"
_refObjectName: "My Workspace",
Projects: [
{
_ref: "/project/3.js"
_refObjectName: "Project 1"
}
]
]
}

The REST URL would look like this
https://rally1.rallydev.com/slm/webservice/1.29/subscription?fetch=Workspaces,Name,Projects

I tried in postman with basic authentication: username and password of rally:
All APIs are inter related : let us see step by step and always notice the _ref in your response.
Step 1: First you want the subscription.
https://rally1.rallydev.com/slm/webservice/v2.0/subscription?fetch=Workspaces,Name,Projects
It will return subscription ID suppose it is X.
Step 2: Find the workspaces in that subscription. Put X value as subscription shown below.
https://rally1.rallydev.com/slm/webservice/v2.0/Subscription/X/Workspaces
It will return the workspace id. Let us say it Y.
Step 3: Find the projects in the workspace.
https://rally1.rallydev.com/slm/webservice/v2.0/Workspace/Y/Projects?fetch=ObjectID
There will be URLs in the response which refers to your projects associated to your workspace.
OR,
if you know your workspace ID then use below api: your_WS_id= your workspace ID in below request. just replace this.
https://rally1.rallydev.com/slm/webservice/v2.0/Workspace/your_WS_ID/Projects?fetch=Name
I hope it helps.

Related

Can we enable Save Card option with Pay By Link [POST] method

I'm working on Global Payments system and trying to achieve Pay By Link http post method to generate the link and share with customer to pay at their convenient time. In the sandbox url below request body is working fine.
{
"SHA1HASH": "606ab12bb09f5e68b1d72ce26622650d485583fd",
"TIMESTAMP": "20210612042252",
"MERCHANT_ID": "somehotel",
"ACCOUNT": "internet",
"ORDER_ID": "5ef1c1ce6da546069998744bdce3d8c9",
"AMOUNT": "2000",
"CURRENCY": "EUR",
"AUTO_SETTLE_FLAG": "1",
"COMMENT1": "Email Channel",
"HPP_VERSION": "2",
"HPP_LANG": "en",
"HPP_CUSTOMER_EMAIL": "somebody#gmail.com",
"HPP_CUSTOMER_PHONENUMBER_MOBILE": "91|9999999999",
"HPP_BILLING_STREET1": "Flat 123",
"HPP_BILLING_STREET2": "House 456",
"HPP_BILLING_STREET3": "Unit 4",
"HPP_BILLING_CITY": "Halifax",
"HPP_BILLING_POSTALCODE": "W5 9HR",
"HPP_BILLING_COUNTRY": "826",
"HPP_SHIPPING_STREET1": "Apartment 852",
"HPP_SHIPPING_STREET2": "Complex 741",
"HPP_SHIPPING_STREET3": "House 963",
"HPP_SHIPPING_CITY": "Chicago",
"HPP_SHIPPING_STATE": "IL",
"HPP_SHIPPING_POSTALCODE": "50001",
"HPP_SHIPPING_COUNTRY": "840",
"HPP_ADDRESS_MATCH_INDICATOR": "FALSE",
"HPP_CHALLENGE_REQUEST_INDICATOR": "NO_PREFERENCE",
"BILLING_CODE": "59|123",
"BILLING_CO": "GB",
"SHIPPING_CODE": "50001|Apartment 852",
"SHIPPING_CO": "US",
"CUST_NUM": "6e027928-c477-4689-a45f-4e138a1f208a",
"VAR_REF": "Acme Corporation",
"PROD_ID": "SKU1000054",
"MERCHANT_RESPONSE_URL": "https://www.example.com/responseUrl",
"SUPPLEMENTARY_DATA": "Custom Value"
}
Is there a way to enable Save Card option. I tried providing the below flags as seen on another payment reference, but the response started giving hash error.
Request Body included below
"CARD_STORAGE_ENABLE": "1",
"OFFER_SAVE_CARD": "1",
"PAYER_EXIST": "0",
"PAYER_REF": "376a2598-412d-4805-9f47-c177d5605853",
"PMT_REF": "ca46344d-4292-47dc-9ced-e8a42ce66977",
And the response from server
{
"resultCode":508,
"internalErrorCode":61000,
"errorMessage":"Incorrect hash. Please check your code and the Developers Documentation."
}
Is this a restriction by purpose or are we passing wrong flags? Please help!
These are the two sections from the developer portal describing how to generate the hash:
Card Payments: https://developer.globalpay.com/hpp/card-payments#generate-hash
Card Storage: https://developer.globalpay.com/hpp/card-storage#generate-hash

Get specific fields from Rally API for Feature

I am fetching the data using below API :
https://rally1.rallydev.com/slm/webservice/v2.0/PortfolioItem/Feature/?fetch=ObjectID,FormattedID,Name,Parent&pagesize=2000
I don't want to fetch all fields in Parent. All I need Name,FormattedID,ObjectID,Parent.ObjectID,Parent.Name of Feature. A
{
"_rallyAPIMajor": "2",
"_rallyAPIMinor": "0",
"ObjectID": blabla,
"FormattedID": "F3792",
"DirectChildrenCount": 23,
"Name": "Phase 2: Fork Messages (New flow of messages that will feed data to 8 reports for D&P)",
"Parent": {
"_rallyAPIMajor": "2",
"_rallyAPIMinor": "0",
"_ref": "https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/portfolio/blabla",
"_refObjectUUID": "8fae",
"_objectVersion": "67",
"_refObjectName": "blabla",
"ObjectID": blabla,
"FormattedID": "P1ABC",
"DirectChildrenCount": 13,
"Name": "blabla",
"_type": "PortfolioItem/Portfolio"
},
"_type": "PortfolioItem/Feature"
}
This is just the way the Web Services API works. Any fields included in the fetch will be returned on any object that has them. This is very useful for being able to hydrate fields on associated objects- Parent, Iteration, etc.

How do I automate adding a custom Iot Hub Endpoint (and route to it)?

In order to receive Azure IotHub Device Twin change notifications, it appears that it's necessary to create a custom endpoint and create a route to send notifications to that endpoint. This seems straightforward enough on the Azure Portal, but as one might expect we want to automate it.
I haven't been able to find any documentation for the the az cli or even the REST API, though I might have missed something. I didn't find anything promising looking in the SDKs either.
How do I automate adding a custom endpoint and then setting up the route for device twin notifications?
You can check IotHubs template to see if it helps.
Route:
"routing": {
"endpoints": {
"serviceBusQueues": [
{
"connectionString": "string",
"name": "string",
"subscriptionId": "string",
"resourceGroup": "string"
}
]
},
"routes": [
{
"name": "string",
"source": "string",
"condition": "string",
"endpointNames": [
"string"
],
"isEnabled": boolean
}
],
Consumer group:
{
"apiVersion": "2016-02-03",
"type": "Microsoft.Devices/IotHubs/eventhubEndpoints/ConsumerGroups",
"name": "[concat(parameters('hubName'), '/events/cg1')]",
"dependsOn": [
"[concat('Microsoft.Devices/Iothubs/', parameters('hubName'))]"
]
},
For more detailed information you can reference:
Microsoft.Devices/IotHubs template reference
Create an IoT hub using Azure Resource Manager template (PowerShell)

HERE Places API: not all items have PVID

I'm using HERE Places API.
Firstly I'm doing a search.
For Example this query :
https://places.cit.api.here.com/places/v1/discover/search?q=Test&at=35.6111,-97.5467&r=500&size=1&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid&pretty
According to this documentation (Link) If I add show_refs=pvid to query string, in result I will get external id which I can use to query lookup endpoint.
But in result I get next response :
{
"results": {
"next": "https://places.cit.api.here.com/places/v1/discover/search;context=Zmxvdy1pZD1hY2ExNzk3NC0zYzg3LTU5NzQtYmZkMC04YjAzMDZlYWIzMWJfMTUwNjA3NjMzMTYyMl83NDY3XzM4NTAmb2Zmc2V0PTEmc2l6ZT0x?at=35.6111%2C-97.5467&q=Test&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"items": [
{
"position": [
35.60369,
-97.51761
],
"distance": 2756,
"title": "Southwest Test & Balance",
"averageRating": 0,
"category": {
"id": "business-services",
"title": "Business & Services",
"href": "https://places.cit.api.here.com/places/v1/categories/places/business-services?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"type": "urn:nlp-types:category",
"system": "places"
},
"icon": "https://download.vcdn.cit.data.here.com/p/d/places2_stg/icons/categories/02.icon",
"vicinity": "200 NW 132nd St<br/>Oklahoma City, OK 73114",
"having": [],
"type": "urn:nlp-types:place",
"href": "https://places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD1hY2ExNzk3NC0zYzg3LTU5NzQtYmZkMC04YjAzMDZlYWIzMWJfMTUwNjA3NjMzMTYyMl83NDY3XzM4NTAmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg",
"id": "8403fv6k-d1b2fde0616e0326e321a54b88cd9f53",
"authoritative": true
}
]
},
"search": {
"context": {
"location": {
"position": [
35.6111,
-97.5467
],
"address": {
"text": "Oklahoma City, OK 73134<br/>USA",
"postalCode": "73134",
"city": "Oklahoma City",
"county": "Oklahoma",
"stateCode": "OK",
"country": "United States",
"countryCode": "USA"
}
},
"type": "urn:nlp-types:place",
"href": "https://places.cit.api.here.com/places/v1/places/loc-dmVyc2lvbj0xO3RpdGxlPU9rbGFob21hK0NpdHk7bGF0PTM1LjYxMTE7bG9uPS05Ny41NDY3O2NpdHk9T2tsYWhvbWErQ2l0eTtwb3N0YWxDb2RlPTczMTM0O2NvdW50cnk9VVNBO3N0YXRlQ29kZT1PSztjb3VudHk9T2tsYWhvbWE7Y2F0ZWdvcnlJZD1jaXR5LXRvd24tdmlsbGFnZTtzb3VyY2VTeXN0ZW09aW50ZXJuYWw;context=c2VhcmNoQ29udGV4dD0x?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg"
}
}
}
In response no object references
Is it a bug or not every place has this external id?
I am responding as member of the team around HERE Places API.
Yes, not every place has a pvid. That is why I would suggest using the Sharing Id instead. I realize that the documentation should be improved to clarify that.
The Sharing Ids can be obtained by adding show_refs=sharing to either your search query or a place details request. It can be found in the field references. Once you have the sharing id you can you the lookup endpoint as you intended.
Take a look at:
https://places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD00YWU2ZWZjNi01ZjgzLTUwYTQtOTI4OS0xZjliMGMwNWY3NjBfMTUwNzA0NDE0OTc3NV84MTI5XzU1NDcmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid
and
https://places.cit.api.here.com/places/v1/places/8409q8yy-6af3c3e50bcb4f859686797b2be5773d;context=Zmxvdy1pZD00YWU2ZWZjNi01ZjgzLTUwYTQtOTI4OS0xZjliMGMwNWY3NjBfMTUwNzA0NDE0OTc3NV84MTI5XzU1NDcmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg&show_refs=pvid
On those two examples, the only difference is the placeId.
In the docs, there's not a single reference saying that the external identifier is required or existant for every place.
Since it represents an external identifier, I believe we could assume that it's not required.
And it's what we just saw with your place (8403fv6k-d1b2fde0616e0326e321a54b88cd9f53): this one don't have any external identifier.
Based on your comments, what you need is the information about a place.
So, after you run your first query, you should get something like:
{
title: "Southwest Test & Balance",
position: [],
id: "8403fv6k-d1b2fde0616e0326e321a54b88cd9f53",
href: "https://[...]"
}
With this ID, you could access it:
places.cit.api.here.com/places/v1/places/8403fv6k-d1b2fde0616e0326e321a54b88cd9f53;context=Zmxvdy1pZD0zYTFlZjg5ZS02ZTY5LTUxYmEtYWFkYS1kY2UwZWMyNDdkMDBfMTUwNzEzNjUxNjI5N182NjExXzc2OTgmcmFuaz0w?app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg
Or directly using the href information.
This response already is giving you the ID and URL to access all the info of a single place.
You don't need any other external ID or reference.

ARM - How can I get the access key from a storage account to use in AppSettings later in the template?

I'm creating an Azure Resource Manager template that instantiates multiple resources, including an Azure storage account and an Azure App Service with a Web App.
I'd like to be able to capture the primary access key (or the full connection string, either way is fine) from the newly-created storage account, and use that as a value for one of the AppSettings for the Web App.
Is that possible?
Use the listkeys helper function.
"appSettings": [
{
"name": "STORAGE_KEY",
"value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]"
}
]
This quickstart does something similar:
https://azure.microsoft.com/en-us/documentation/articles/cache-web-app-arm-with-redis-cache-provision/
The syntax has changed since the other answer was accepted. The error you will now hit is 'Template language expression property 'key1' doesn't exist, available properties are 'keys'
Keys are now represented as an array of keys, and the syntax is now:
"StorageAccount": "[Concat('DefaultEndpointsProtocol=https;AccountName=',variables('StorageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('StorageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value)]",
See: http://samcogan.com/retrieve-azure-storage-key-in-arm-script/
I faced with this issue two times. First in the 2015 and last today in May of 2017.
I need to add connection strings to the WebApp - I want to add strings automatically from generated resources during deployment from the ARM template. It can help later to not add manually this values.
First time I used old version of the function listKeys (it looks like old version returns result not as object but as value):
"AzureWebJobsStorage": {
"type": "Custom",
"value": "[concat(variables('storageConnectionString'), listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2015-05-01-preview').key1)]"
},
Today last version of the working template is:
"resources": [
{
"apiVersion": "2015-08-01",
"type": "config",
"name": "connectionstrings",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites/', parameters('webSiteName'))]"
],
"properties": {
"DefaultConnection": {
"value": "[concat('Data Source=tcp:', reference(resourceId('Microsoft.Sql/servers/', parameters('sqlserverName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', parameters('databaseName'), ';User Id=', parameters('administratorLogin'), '#', parameters('sqlserverName'), ';Password=', parameters('administratorLoginPassword'), ';')]",
"type": "SQLServer"
},
"AzureWebJobsStorage": {
"type": "Custom",
"value": "[concat(variables('storageConnectionString'), listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageName')), '2016-01-01').keys[0].value)]"
},
"AzureWebJobsDashboard": {
"type": "Custom",
"value": "[concat(variables('storageConnectionString'), listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageName')), '2016-01-01').keys[0].value)]"
}
}
},
Thanks.
below is example for adding storage account to ADLA
"storageAccounts": [
{
"name": "[parameters('DataLakeAnalyticsStorageAccountname')]",
"properties": {
"accessKey": "[listKeys(variables('storageAccountid'),'2015-05-01-preview').key1]"
}
}
],
in variable you can keep
"variables": {
"apiVersion": "[providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]]",
"storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', parameters('DataLakeAnalyticsStorageAccountname'))]"
},