Please "move" the access_url property from links to domains

Bug #1412625 reported by Shaunak Kashyap
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Poppy
Triaged
Wishlist
Mohan Madhavan

Bug Description

Currently, when a service with multiple domains is retrieved using the GET /services/{service_id} API, a JSON structure like below is returned:

{
    "services": [
        {
            "name": "mywebsite.com",
            "id": "9fb249d5-47bd-47a6-94c5-94df4deb6a80",
            "domains": [
                {
                    "domain": "www2.mywebsite.com",
                    "protocol": "http"
                },
                {
                    "domain": "blog3.mywebsite.com",
                    "protocol": "http"
                }
            ],
            "origins": [
                {
                    "origin": "mywebsite.com",
                    "port": 80,
                    "ssl": false,
                    "rules": []
                }
            ],
            "restrictions": [
                {
                    "name": "website only",
                    "rules": [
                        {
                            "name": "mywebsite.com"
                        }
                    ]
                }
            ],
            "caching": [
                {
                    "name": "default",
                    "ttl": 3600
                }
            ],
            "status": "deployed",
            "flavor_id": "cdn",
            "errors": [],
            "links": [
                {
                    "href": "https://global.cdn.api.rackspacecloud.com/v1.0/123456/services/9fb249d5-47bd-47a6-94c5-94df4deb6a80",
                    "rel": "self"
                },
                {
                    "href": "https://global.cdn.api.rackspacecloud.com/v1.0/123456/flavors/cdn",
                    "rel": "flavor"
                },
                {
                    "href": "www2.mywebsite.com.cdn464.raxcdn.com",
                    "rel": "access_url"
                },
                {
                    "href": "blog3.mywebsite.com.cdn464.raxcdn.com",
                    "rel": "access_url"
                }
            ]
        }
    ],
    "links": [
        {
            "href": "https://global.cdn.api.rackspacecloud.com/v1.0/123456/services?marker=9fb249d5-47bd-47a6-94c5-94df4deb6a80&limit=10",
            "rel": "next"
        }
    ]
}

As expected there are two "access_url" links, corresponding to the two domains for this service. However, it is not easy to programmatically determine the 1-1 corresponding between a domain and its access_url without resorting to string/regex matching between domains and access_url hrefs.

To alleviate this issue, please consider moving the access_urls out of "links" and into each domain object inside the "domains" array. Also, as the values of these "access_url" hrefs are not actually URLs - they are domain names -, please consider naming the new property inside each domain object appropriately, like "access_domain" or similar.

In order to preserve backwards compatibility, you might need to just copy these values from the "links" array instead of moving them.

Changed in poppy:
milestone: none → kilo-3
importance: Undecided → Medium
Changed in poppy:
milestone: kilo-3 → liberty-1
Changed in poppy:
milestone: liberty-1 → none
Changed in poppy:
status: New → Triaged
importance: Medium → Wishlist
Changed in poppy:
assignee: nobody → Mohan Madhavan (mohan-madhavan)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.