l.s.i.s.ISnapStoreClient(Interface) : interface documentation

Part of lp.snappy.interfaces.snapstoreclient View In Hierarchy

Interface for the API provided by the snap store.
Method requestPackageUploadPermission Request permission from the store to upload builds of a snap.
Method upload Upload a snap build to the store.
Method refreshDischargeMacaroon Refresh a snap's discharge macaroon.
Method refreshIfNecessary Call a function, refreshing macaroons if necessary.
Method checkStatus Poll the store once for upload scan status.
Method listChannels Fetch the current list of channels from the store.
def requestPackageUploadPermission(snappy_series, snap_name):
Request permission from the store to upload builds of a snap.

The returned macaroon will include a third-party caveat that must be discharged by the login service. This method does not acquire that discharge; it must be acquired separately.

Parameterssnappy_seriesThe ISnappySeries in which this snap should be published on the store.
snap_nameThe registered name of this snap on the store.
ReturnsA serialized macaroon appropriate for uploading builds of this snap.
def upload(snapbuild):
Upload a snap build to the store.
ParameterssnapbuildThe ISnapBuild to upload.
ReturnsA URL to poll for upload processing status.
RaisesBadRefreshResponseif the authorising macaroons need to be refreshed, but attempting to do so fails.
UnauthorizedUploadResponseif the user who authorised this upload is not themselves authorised to upload the snap in question.
UploadFailedResponseif uploading the build to the store failed.
def refreshDischargeMacaroon(snap):
Refresh a snap's discharge macaroon.
ParameterssnapAn ISnap whose discharge macaroon needs to be refreshed.
def refreshIfNecessary(snap, f, *args, **kwargs):
Call a function, refreshing macaroons if necessary.

If the called function raises NeedsRefreshResponse, then this calls refreshDischargeMacaroon and tries again.

ParameterssnapAn ISnap whose discharge macaroon may need to be refreshed.
fThe function to call.
argsPositional arguments to f.
kwargsKeyword arguments to f.
def checkStatus(status_url):
Poll the store once for upload scan status.
Parametersstatus_urlA URL as returned by upload.
ReturnsA tuple of (url, revision), where url is a URL on the store with further information about this upload, and revision is the store revision number for the upload or None.
RaisesUploadNotScannedYetResponseif the store has not yet scanned the upload.
BadScanStatusResponseif the store failed to scan the upload.
def listChannels():
Fetch the current list of channels from the store.
ReturnsA list of dictionaries, one per channel, each of which contains at least "name" and "display_name" keys.
RaisesBadSearchResponseif the attempt to fetch the list of channels from the store fails.
API Documentation for Launchpad, generated by pydoctor at 2020-12-04 00:00:03.