l.s.i.w.ISnapSet(Interface) : interface documentation

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

A utility to create and access snap packages.
Method new Create an ISnap.
Method exists Check to see if a matching snap exists.
Method isValidPrivacy Whether or not the privacy context is valid.
Method getByName Return the appropriate ISnap for the given objects.
Method findByOwner Return all snap packages with the given owner.
Method findByPerson Return all snap packages relevant to person.
Method findByProject Return all snap packages for the given project.
Method findByBranch Return all snap packages for the given Bazaar branch.
Method findByGitRepository Return all snap packages for the given Git repository.
Method findByGitRef Return all snap packages for the given Git reference.
Method findByContext Return all snap packages for the given context.
Method findByURL Return all snap packages that build from the given URL.
Method findByURLPrefix Return all snap packages that build from a URL with this prefix.
Method findByURLPrefixes Return all snap packages that build from a URL with any of these
Method findByStoreName Return all snap packages with the given store package name.
Method preloadDataForSnaps Load the data related to a list of snap packages.
Method getSnapcraftYaml Fetch a package's snapcraft.yaml from code hosting, if possible.
Method makeAutoBuilds Create and return automatic builds for stale snap packages.
Method detachFromBranch Detach all snap packages from the given Bazaar branch.
Method detachFromGitRepository Detach all snap packages from the given Git repository.
Method empty_list Return an empty collection of snap packages.
@call_with(REQUEST_USER)
@operation_parameters(List(Reference(IProcessor), False))
@export_factory_operation(ISnap, 'owner''distro_series''name''description''branch''git_repository''git_repository_url''git_path''git_ref''auto_build''auto_build_archive''auto_build_pocket''private''store_upload''store_series''store_name''store_channels')
@operation_for_version('devel')
def new(registrant, owner, distro_series, name, description=None, branch=None, git_repository=None, git_repository_url=None, git_path=None, git_ref=None, auto_build=False, auto_build_archive=None, auto_build_pocket=None, require_virtualized=True, processors=None, date_created=None, private=False, store_upload=False, store_series=None, store_name=None, store_secrets=None, store_channels=None):
Create an ISnap.
def exists(owner, name):
Check to see if a matching snap exists.
def isValidPrivacy(private, owner, branch=None, git_ref=None):
Whether or not the privacy context is valid.
@operation_parameters(Reference(IPerson, _('Owner'), True), TextLine(_('Snap name'), True))
@operation_returns_entry(ISnap)
@export_read_operation()
@operation_for_version('devel')
def getByName(owner, name):
Return the appropriate ISnap for the given objects.
@operation_parameters(Reference(IPerson, _('Owner'), True))
@operation_returns_collection_of(ISnap)
@export_read_operation()
@operation_for_version('devel')
def findByOwner(owner):
Return all snap packages with the given owner.
def findByPerson(person, visible_by_user=None):
Return all snap packages relevant to person.

This returns snap packages for Bazaar or Git branches owned by person, or where person is the owner of the snap package.

ParameterspersonAn IPerson.
visible_by_userIf not None, only return packages visible by this user; otherwise, only return publicly-visible packages.
def findByProject(project, visible_by_user=None):
Return all snap packages for the given project.
ParametersprojectAn IProduct.
visible_by_userIf not None, only return packages visible by this user; otherwise, only return publicly-visible packages.
def findByBranch(branch):
Return all snap packages for the given Bazaar branch.
def findByGitRepository(repository, paths=None):
Return all snap packages for the given Git repository.
ParametersrepositoryAn IGitRepository.
pathsIf not None, only return snap packages for one of these Git reference paths.
def findByGitRef(ref):
Return all snap packages for the given Git reference.
def findByContext(context, visible_by_user=None, order_by_date=True):
Return all snap packages for the given context.
ParameterscontextAn IPerson, IProduct, `IBranch, IGitRepository, or IGitRef.
visible_by_userIf not None, only return packages visible by this user; otherwise, only return publicly-visible packages.
order_by_dateIf True, order packages by descending modification date.
RaisesBadSnapSearchContextif the context is not understood.
@operation_parameters(TextLine(_('The URL to search for.')), Reference(IPerson, _('Owner'), False))
@call_with(REQUEST_USER)
@operation_returns_collection_of(ISnap)
@export_read_operation()
@operation_for_version('devel')
def findByURL(url, owner=None, visible_by_user=None):
Return all snap packages that build from the given URL.

This currently only works for packages that build directly from a URL, rather than being linked to a Bazaar branch or Git repository hosted in Launchpad.

ParametersurlA URL.
ownerOnly return packages owned by this user.
visible_by_userIf not None, only return packages visible by this user; otherwise, only return publicly-visible packages.
@operation_parameters(TextLine(_('The URL prefix to search for.')), Reference(IPerson, _('Owner'), False))
@call_with(REQUEST_USER)
@operation_returns_collection_of(ISnap)
@export_read_operation()
@operation_for_version('devel')
def findByURLPrefix(url_prefix, owner=None, visible_by_user=None):
Return all snap packages that build from a URL with this prefix.

This currently only works for packages that build directly from a URL, rather than being linked to a Bazaar branch or Git repository hosted in Launchpad.

Parametersurl_prefixA URL prefix.
ownerOnly return packages owned by this user.
visible_by_userIf not None, only return packages visible by this user; otherwise, only return publicly-visible packages.
@operation_parameters(List(_('The URL prefixes to search for.'), TextLine()), Reference(IPerson, _('Owner'), False))
@call_with(REQUEST_USER)
@operation_returns_collection_of(ISnap)
@export_read_operation()
@operation_for_version('devel')
def findByURLPrefixes(url_prefixes, owner=None, visible_by_user=None):
Return all snap packages that build from a URL with any of these prefixes.

This currently only works for packages that build directly from a URL, rather than being linked to a Bazaar branch or Git repository hosted in Launchpad.

Parametersurl_prefixesA list of URL prefixes.
ownerOnly return packages owned by this user.
visible_by_userIf not None, only return packages visible by this user; otherwise, only return publicly-visible packages.
@operation_parameters(TextLine(_('The registered store package name to search for.')), Reference(IPerson, _('Owner'), False))
@call_with(REQUEST_USER)
@operation_returns_collection_of(ISnap)
@export_read_operation()
@operation_for_version('devel')
def findByStoreName(store_name, owner=None, visible_by_user=None):
Return all snap packages with the given store package name.
Parametersstore_nameA registered store package name.
ownerOnly return packages owned by this user.
visible_by_userIf not None, only return packages visible by this user; otherwise, only return publicly-visible packages.
def preloadDataForSnaps(snaps, user):
Load the data related to a list of snap packages.
def getSnapcraftYaml(context, logger=None):
Fetch a package's snapcraft.yaml from code hosting, if possible.
ParameterscontextEither an ISnap or the source branch for a snap package.
loggerAn optional logger.
ReturnsThe package's parsed snapcraft.yaml.
RaisesMissingSnapcraftYamlif this package has no snapcraft.yaml.
CannotFetchSnapcraftYamlif it was not possible to fetch snapcraft.yaml from the code hosting backend for some other reason.
CannotParseSnapcraftYamlif the fetched snapcraft.yaml cannot be parsed.
def makeAutoBuilds(logger=None):
Create and return automatic builds for stale snap packages.
ParametersloggerAn optional logger.
def detachFromBranch(branch):
Detach all snap packages from the given Bazaar branch.

After this, any snap packages that previously used this branch will have no source and so cannot dispatch new builds.

def detachFromGitRepository(repository):
Detach all snap packages from the given Git repository.

After this, any snap packages that previously used this repository will have no source and so cannot dispatch new builds.

@collection_default_content()
def empty_list():
Return an empty collection of snap packages.

This only exists to keep lazr.restful happy.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.