Class: QgsArcGisPortalUtils

class qgis.core.QgsArcGisPortalUtils

Bases: sip.wrapper

Utility functions for working with ArcGIS REST services.

New in version 3.18:

Methods

retrieveGroupContent

Retrieves JSON definitions for all items which belong the the specified groupId.

retrieveGroupItemsOfType

Retrieves JSON definitions for all items which belong the the specified groupId.

retrieveUserGroups

Retrieves JSON definitions for all groups which the specified user name is a member of.

retrieveUserInfo

Retrieves JSON user info for the specified user name.

Attributes

FeatureService

ImageService

MapService

FeatureService = 0
ImageService = 2
class ItemType

Bases: int

MapService = 1
retrieveGroupContent(contentUrl: str, groupId: str, authcfg: str, requestHeaders: Dict[str, str] = {}, feedback: QgsFeedback = None, pageSize: int = 100) Tuple[List[Any], str, str]

Retrieves JSON definitions for all items which belong the the specified groupId.

Parameters
  • contentUrl (str) – should be set to the Portal’s content URL, e.g. https://mysite.com/portal/sharing/rest/content

  • groupId (str) – ID of group to query

  • authcfg (str) – authentication configuration ID

  • requestHeaders (Dict[str) – optional additional request headers

  • feedback (QgsFeedback = None) – optional feedback argument for cancellation support

  • pageSize (int = 100) – number of results to retrieve for each request. Maximum value is 100.

Return type

Tuple[List[Any], str, str]

Returns

  • a list of JSON item info for all items within the group

  • errorTitle: title summary of any encountered errors

  • errorText: error text of any encountered errors

retrieveGroupItemsOfType(contentUrl: str, groupId: str, authcfg: str, itemTypes: Iterable[int], requestHeaders: Dict[str, str] = {}, feedback: QgsFeedback = None, pageSize: int = 100) Tuple[List[Any], str, str]

Retrieves JSON definitions for all items which belong the the specified groupId.

Parameters
  • contentUrl (str) – should be set to the Portal’s content URL, e.g. https://mysite.com/portal/sharing/rest/content

  • groupId (str) – ID of group to query

  • authcfg (str) – authentication configuration ID

  • itemTypes (Iterable[int]) – list of desired item types (using QgsArcGisPortalUtils.ItemType values)

  • requestHeaders (Dict[str) – optional additional request headers

  • feedback (QgsFeedback = None) – optional feedback argument for cancellation support

  • pageSize (int = 100) – number of results to retrieve for each request. Maximum value is 100.

Return type

Tuple[List[Any], str, str]

Returns

  • a list of JSON item info for all items within the group

  • errorTitle: title summary of any encountered errors

  • errorText: error text of any encountered errors

retrieveUserGroups(communityUrl: str, user: str, authcfg: str, requestHeaders: Dict[str, str] = {}, feedback: QgsFeedback = None) Tuple[List[Any], str, str]

Retrieves JSON definitions for all groups which the specified user name is a member of.

If user is blank then the user associated with the current logon details will be retrieved

Parameters
  • communityUrl (str) – should be set to the Portal’s community URL, e.g. https://mysite.com/portal/sharing/rest/community

  • user (str) – username to query, or an empty string to query the current user

  • authcfg (str) – authentication configuration ID

  • requestHeaders (Dict[str) – optional additional request headers

  • feedback (QgsFeedback = None) – optional feedback argument for cancellation support

Return type

Tuple[List[Any], str, str]

Returns

  • a list of JSON group info

  • errorTitle: title summary of any encountered errors

  • errorText: error text of any encountered errors

retrieveUserInfo(communityUrl: str, user: str, authcfg: str, requestHeaders: Dict[str, str] = {}, feedback: QgsFeedback = None) Tuple[Dict[str, Any], str, str]

Retrieves JSON user info for the specified user name.

If user is blank then the user associated with the current logon details will be retrieved

Parameters
  • communityUrl (str) – should be set to the Portal’s community URL, e.g. https://mysite.com/portal/sharing/rest/community

  • user (str) – username to query, or an empty string to query the current user

  • authcfg (str) – authentication configuration ID

  • requestHeaders (Dict[str) – optional additional request headers

  • feedback (QgsFeedback = None) – optional feedback argument for cancellation support

Return type

Tuple[Dict[str, Any], str, str]

Returns

  • JSON user info

  • errorTitle: title summary of any encountered errors

  • errorText: error text of any encountered errors