Class: QgsArcGisPortalUtils

class qgis.core.QgsArcGisPortalUtils

Bases: sip.wrapper

Utility functions for working with ArcGIS REST services.

New in version 3.18:

Enums

ItemType

alias of ArcGisRestServiceType

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.

ItemType

alias of ArcGisRestServiceType

retrieveGroupContent(contentUrl: str, groupId: str, authcfg: str, requestHeaders: QgsHttpHeaders = QgsHttpHeaders(), 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 (QgsHttpHeaders = QgsHttpHeaders()) – 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.

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

New in version 3.24.

retrieveGroupContent(contentUrl: str, groupId: str, authcfg: str, requestHeaders: Dict[str, Any], feedback: QgsFeedback = None, pageSize: int = 100) -> Tuple[List[Any], str, str] Retrieves JSON definitions for all items which belong the the specified groupId. Only to avoid API break.

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

  • groupId – ID of group to query

  • authcfg – authentication configuration ID

  • requestHeaders – optional additional request headers

  • feedback – optional feedback argument for cancellation support

  • pageSize – 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

Deprecated since version QGIS: 3.24 use the version with QgsHttpHeaders instead

retrieveGroupItemsOfType(contentUrl: str, groupId: str, authcfg: str, itemTypes: Iterable[int], requestHeaders: QgsHttpHeaders = QgsHttpHeaders(), 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 Qgis.ArcGisRestServiceType values)

  • requestHeaders (QgsHttpHeaders = QgsHttpHeaders()) – 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.

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

New in version 3.24.

retrieveGroupItemsOfType(contentUrl: str, groupId: str, authcfg: str, itemTypes: Iterable[int], requestHeaders: Dict[str, Any], feedback: QgsFeedback = None, pageSize: int = 100) -> Tuple[List[Any], str, str] Retrieves JSON definitions for all items which belong the the specified groupId. Only to avoid API break.

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

  • groupId – ID of group to query

  • authcfg – authentication configuration ID

  • itemTypes – list of desired item types (using Qgis.ArcGisRestServiceType values)

  • requestHeaders – optional additional request headers

  • feedback – optional feedback argument for cancellation support

  • pageSize – 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

Deprecated since version QGIS: 3.24 use the version with QgsHttpHeaders instead

retrieveUserGroups(communityUrl: str, user: str, authcfg: str, requestHeaders: QgsHttpHeaders = QgsHttpHeaders(), 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 (QgsHttpHeaders = QgsHttpHeaders()) – optional additional request headers

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

Returns:

  • a list of JSON group info

  • errorTitle: title summary of any encountered errors

  • errorText: error text of any encountered errors

New in version 3.24.

retrieveUserGroups(communityUrl: str, user: str, authcfg: str, requestHeaders: Dict[str, Any], feedback: QgsFeedback = None) -> Tuple[List[Any], str, str] Retrieves JSON definitions for all groups which the specified user name is a member of. Only to avoid API break.

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

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

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

  • authcfg – authentication configuration ID

  • requestHeaders – optional additional request headers

  • feedback – 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

Deprecated since version QGIS: 3.24 use the version with QgsHttpHeaders instead

retrieveUserInfo(communityUrl: str, user: str, authcfg: str, requestHeaders: QgsHttpHeaders = QgsHttpHeaders(), 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 (QgsHttpHeaders = QgsHttpHeaders()) – optional additional request headers

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

Returns:

  • JSON user info

  • errorTitle: title summary of any encountered errors

  • errorText: error text of any encountered errors

New in version 3.24.

retrieveUserInfo(communityUrl: str, user: str, authcfg: str, requestHeaders: Dict[str, Any], feedback: QgsFeedback = None) -> Tuple[Dict[str, Any], str, str] Retrieves JSON user info for the specified user name. Only to avoid API break.

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

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

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

  • authcfg – authentication configuration ID

  • requestHeaders – optional additional request headers

  • feedback – 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

Deprecated since version QGIS: 3.24 use the version with QgsHttpHeaders instead