Info

snap_info

Introduced in version 1

Summary: GET /v2/snaps/info/<snap_name>

Get info from the snap and its released revisions.

The endpoint can contain the following fields in its query part:

  • fields: the list of the fields (separated by comma) to return; it's optional, defaults to return the created-at, download, license, name, prices, publisher, revision, snap-id, store-url, summary, title, type and version fields. The list of all available fields is: architectures, base, categories, channel-map, common-ids, confinement, contact, created-at, description, download, epoch, gated-snap-ids, license, links, media, name, prices, private, publisher, resources, revision, snap-id, snap-yaml, store-url, summary, title, trending, type, unlisted, version, `website.

  • architecture: a specific architecture to filter the returned channel map entries; it's optional and recommended, if not present no filtering will be done.

The client must send the Snap-Device-Series and User-Agent mandatory headers. For the Snap-Device-Series header, the only supported value so far is '16'.

A successful response will be a json-encoded dict with the following information:

  • name: the snap name

  • snap-id: the snap id

  • snap: a dict with all the requested fields that belongs to the snap (not its revisions), except the channel maps

  • default-track: the default track set for the snap (if any)

  • channel-map: a list of channel mappings (see below for structure)

Each item inside the channel-map list will be a dict holding:

  • channel: a dictionary with keys:

    • name: the channel name, composed by the track and the risk shown below

    • track: the channel track

    • risk: the channel risk

    • architecture: the revision's architecture (note that this is unrelated to device's architecture)

    • released-at: string, when snap revision was released in this channel, the value will be encoded in ISO 8601 and will be null if there is no candidate revision.

  • any other fields for the revision according to what was requested by the client

If the released snap revision has resources attached and if resources field is requested, a resources array will also be appended containing dicts holding the following resource revision related info:

  • download: a dictionary with keys:
    • sha3-384: the sha3-384 checksum
    • size: the size in bytes
    • url: the download url
  • type: the type (eg. component/kernel-modules)
  • name: the resource name
  • revision: the revision
  • version: the version (can be null)
  • created-at: the creation date
  • description: the description

Some considerations about this structure:

  • if the channel doesn't have any revision released into it (e.g. beta is closed, so it just redirects to stable), it will be not present

  • branches will not be returned

  • items in the channel-map list will be ordered by (track, risk, architecture); the track that is None will come always first in the list, using name 'latest'

  • fields inside the channel object could potentially grow to include other relevant info

  • if the snap doesn't have any released revision for the given request, channel-map will be present and empty

snap_info changelog

  • Version 57: Added attached 'resources' field in channel-map
  • Version 21: Added support for snap field 'links'.
  • Version 18: Added support for snap field 'unlisted'.
  • Version 17: Added support for 'store-url'.
  • Version 16: Added support for 'trending' field.
  • Version 15: Media 'width' & 'height' may be populated with integers.
  • Version 14: Added support for 'default-track' field.
  • Version 11: Added support for 'categories' field.
  • Version 5: Added support for 'released-at' field.
  • Version 4: Added support for 'website' field.
  • Version 3: Added validation field for publisher objects.

Response JSON Schema

{
    "additionalProperties": false,
    "properties": {
        "channel-map": {
            "items": {
                "additionalProperties": false,
                "properties": {
                    "architectures": {
                        "items": {
                            "type": "string"
                        },
                        "type": "array"
                    },
                    "base": {
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "type": "string"
                            }
                        ]
                    },
                    "channel": {
                        "additionalProperties": false,
                        "properties": {
                            "architecture": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            },
                            "released-at": {
                                "introduced_at": 5,
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "risk": {
                                "type": "string"
                            },
                            "track": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "track",
                            "risk",
                            "name",
                            "architecture"
                        ],
                        "type": "object"
                    },
                    "common-ids": {
                        "items": {
                            "type": "string"
                        },
                        "type": "array"
                    },
                    "confinement": {
                        "type": "string"
                    },
                    "created-at": {
                        "type": "string"
                    },
                    "download": {
                        "additionalProperties": false,
                        "properties": {
                            "deltas": {
                                "items": {
                                    "additionalProperties": false,
                                    "properties": {
                                        "format": {
                                            "type": "string"
                                        },
                                        "sha3-384": {
                                            "type": "string"
                                        },
                                        "size": {
                                            "type": "number"
                                        },
                                        "source": {
                                            "type": "number"
                                        },
                                        "target": {
                                            "type": "number"
                                        },
                                        "url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "format",
                                        "sha3-384",
                                        "size",
                                        "source",
                                        "target",
                                        "url"
                                    ],
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            "sha3-384": {
                                "type": "string"
                            },
                            "size": {
                                "type": "number"
                            },
                            "url": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "sha3-384",
                            "size",
                            "url",
                            "deltas"
                        ],
                        "type": "object"
                    },
                    "epoch": {
                        "additionalProperties": false,
                        "properties": {
                            "read": {
                                "items": {
                                    "type": "number"
                                },
                                "type": "array"
                            },
                            "write": {
                                "items": {
                                    "type": "number"
                                },
                                "type": "array"
                            }
                        },
                        "required": [
                            "read",
                            "write"
                        ],
                        "type": [
                            "object",
                            "null"
                        ]
                    },
                    "resources": {
                        "introduced_at": 57,
                        "items": {
                            "additionalProperties": false,
                            "introduced_at": 57,
                            "properties": {
                                "created-at": {
                                    "introduced_at": 57,
                                    "type": "string"
                                },
                                "description": {
                                    "introduced_at": 57,
                                    "type": "string"
                                },
                                "download": {
                                    "introduced_at": 57,
                                    "properties": {
                                        "sha3-384": {
                                            "introduced_at": 57,
                                            "type": "string"
                                        },
                                        "size": {
                                            "introduced_at": 57,
                                            "type": "integer"
                                        },
                                        "url": {
                                            "introduced_at": 57,
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                },
                                "name": {
                                    "introduced_at": 57,
                                    "type": "string"
                                },
                                "revision": {
                                    "introduced_at": 57,
                                    "type": "integer"
                                },
                                "type": {
                                    "introduced_at": 57,
                                    "type": "string"
                                },
                                "version": {
                                    "introduced_at": 57,
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                }
                            },
                            "type": "object"
                        },
                        "type": "array"
                    },
                    "revision": {
                        "type": "number"
                    },
                    "snap-yaml": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "version": {
                        "type": "string"
                    }
                },
                "required": [
                    "channel"
                ],
                "type": "object"
            },
            "type": "array"
        },
        "default-track": {
            "introduced_at": 14,
            "type": [
                "string",
                "null"
            ]
        },
        "error-list": {
            "items": {
                "additionalProperties": false,
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "code",
                    "message"
                ],
                "type": "object"
            },
            "type": "array"
        },
        "name": {
            "type": "string"
        },
        "snap": {
            "additionalProperties": false,
            "properties": {
                "categories": {
                    "introduced_at": 11,
                    "items": {
                        "additionalProperties": false,
                        "properties": {
                            "featured": {
                                "introduced_at": 11,
                                "type": "boolean"
                            },
                            "name": {
                                "introduced_at": 11,
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "featured"
                        ],
                        "type": "object"
                    },
                    "type": "array"
                },
                "contact": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "gated-snap-ids": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "license": {
                    "type": "string"
                },
                "links": {
                    "additionalProperties": {
                        "items": {
                            "type": "string"
                        },
                        "minItems": 1,
                        "type": "array"
                    },
                    "introduced_at": 21,
                    "type": [
                        "object",
                        "null"
                    ]
                },
                "media": {
                    "items": {
                        "additionalProperties": false,
                        "properties": {
                            "height": {
                                "type": [
                                    "null",
                                    "integer"
                                ]
                            },
                            "type": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            },
                            "width": {
                                "type": [
                                    "null",
                                    "integer"
                                ]
                            }
                        },
                        "required": [
                            "type",
                            "url",
                            "width",
                            "height"
                        ],
                        "type": "object"
                    },
                    "type": "array"
                },
                "name": {
                    "type": "string"
                },
                "prices": {
                    "type": "object"
                },
                "private": {
                    "type": "boolean"
                },
                "publisher": {
                    "additionalProperties": false,
                    "properties": {
                        "display-name": {
                            "type": "string"
                        },
                        "id": {
                            "type": "string"
                        },
                        "username": {
                            "type": "string"
                        },
                        "validation": {
                            "introduced_at": 3,
                            "type": "string"
                        }
                    },
                    "required": [
                        "id",
                        "username",
                        "display-name"
                    ],
                    "type": "object"
                },
                "snap-id": {
                    "type": "string"
                },
                "store-url": {
                    "introduced_at": 17,
                    "type": "string"
                },
                "summary": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "trending": {
                    "introduced_at": 16,
                    "type": "boolean"
                },
                "unlisted": {
                    "introduced_at": 18,
                    "type": "boolean"
                },
                "website": {
                    "introduced_at": 4,
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                }
            },
            "type": "object"
        },
        "snap-id": {
            "type": "string"
        }
    },
    "required": [
        "name",
        "snap-id",
        "snap",
        "channel-map"
    ],
    "type": "object"
}

© 2019 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.