l.s.i.s.ISnapEdit(IWebhookTarget) : interface documentation

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

Known subclasses: lp.snappy.interfaces.webservice.ISnap

ISnap methods that require launchpad.Edit permission.
Method requestAutoBuilds Create and return automatic builds for this snap package.
Method beginAuthorization Begin authorizing uploads of this snap package to the store.
Method completeAuthorization Complete authorizing uploads of this snap package to the store.
Method destroySelf Delete this snap package, provided that it has no builds.

Inherited from IWebhookTarget:

List valid_webhook_event_types Valid event types for this object type.
List default_webhook_event_types Default event types for new webhooks attached to this object type.
Method newWebhook Create a new webhook.
@operation_returns_collection_of(Interface)
@export_write_operation()
@operation_for_version('devel')
def requestAutoBuilds(allow_failures=False, fetch_snapcraft_yaml=False, logger=None):
Create and return automatic builds for this snap package.

This webservice API method is deprecated. It is normally better to use the requestBuilds method instead, which can make dispatching decisions based on the contents of snapcraft.yaml.

Parametersallow_failuresIf True, log exceptions other than "already pending" from individual build requests; if False, raise them to the caller.
fetch_snapcraft_yamlIf True, fetch snapcraft.yaml from the appropriate branch or repository and use it to decide which builds to request; if False, fall back to building for all supported architectures.
loggerAn optional logger.
ReturnsA sequence of ISnapBuild instances.
RaisesCannotRequestAutoBuildsif no auto_build_archive or auto_build_pocket is set.
IncompatibleArgumentsif no distro_series is set.
@export_write_operation()
@operation_for_version('devel')
def beginAuthorization():
Begin authorizing uploads of this snap package to the store.

This is intended for use by third-party sites integrating with Launchpad. Most users should visit <snap URL>/+authorize instead.

Parameterssuccess_urlThe URL to redirect to when authorization is complete. If None (only allowed for internal use), defaults to the canonical URL of the snap.
ReturnsThe SSO caveat ID from the package_upload macaroon returned by the store. The third-party site should acquire a discharge macaroon for this caveat using OpenID and then call completeAuthorization.
RaisesCannotAuthorizeStoreUploadsif the snap package is not properly configured for store uploads.
BadRequestPackageUploadResponseif the store returns an error or a response without a macaroon when asked to issue a package_upload macaroon.
SnapAuthorizationBadMacaroonif the package_upload macaroon returned by the store has unsuitable SSO caveats.
@operation_parameters(TextLine(_('Serialized root macaroon'), _('Only required if not already set by beginAuthorization.'), False), TextLine(_('Serialized discharge macaroon'), _('Only required if root macaroon has SSO third-party caveat.'), False))
@export_write_operation()
@operation_for_version('devel')
def completeAuthorization(root_macaroon=None, discharge_macaroon=None):
Complete authorizing uploads of this snap package to the store.

This is intended for use by third-party sites integrating with Launchpad.

Parametersroot_macaroonA serialized root macaroon returned by the store. Only required if not already set by beginAuthorization.
discharge_macaroonThe serialized discharge macaroon returned by SSO via OpenID. Only required if the root macaroon has a third-party caveat addressed to SSO.
RaisesCannotAuthorizeStoreUploadsif the snap package is not properly configured for store uploads.
@export_destructor_operation()
@operation_for_version('devel')
def destroySelf():
Delete this snap package, provided that it has no builds.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.