Class: QgsArcGisPortalUtils¶
Utility functions for working with ArcGIS REST services.
See also
Added in version 3.18.
- class qgis.core.QgsArcGisPortalUtils[source]¶
Bases:
object- ItemType¶
alias of
ArcGisRestServiceType
- static retrieveGroupContent(contentUrl: str | None, groupId: str | None, authcfg: str | None, requestHeaders: QgsHttpHeaders = QgsHttpHeaders(), feedback: QgsFeedback | None = None, pageSize: int = 100, urlPrefix: str | None = '')[source]¶
Retrieves JSON definitions for all items which belong the the specified
groupId.- Parameters:
contentUrl (Optional[str]) – should be set to the Portal’s content URL, e.g. https://mysite.com/portal/sharing/rest/content
groupId (Optional[str]) – ID of group to query
authcfg (Optional[str]) – authentication configuration ID
requestHeaders (
QgsHttpHeaders= QgsHttpHeaders()) – optional additional request headersfeedback (Optional[QgsFeedback] = None) – optional feedback argument for cancellation support
pageSize (int = 100) – number of results to retrieve for each request. Maximum value is 100.
urlPrefix (Optional[str] = '') -> (List[Any]) – http web proxy url prefix
- 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
Added in version 3.24.
retrieveGroupContent(contentUrl: Optional[str], groupId: Optional[str], authcfg: Optional[str], requestHeaders: Dict[Optional[str], Any], feedback: Optional[QgsFeedback] = None, pageSize: int = 100, urlPrefix: Optional[str] = ‘’) -> (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.
urlPrefix – http web proxy url prefix
- 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 3.24: Use the version with
QgsHttpHeadersinstead.
- static retrieveGroupItemsOfType(contentUrl: str | None, groupId: str | None, authcfg: str | None, itemTypes: Iterable[int], requestHeaders: QgsHttpHeaders = QgsHttpHeaders(), feedback: QgsFeedback | None = None, pageSize: int = 100, urlPrefix: str | None = '')[source]¶
Retrieves JSON definitions for all items which belong the the specified
groupId.- Parameters:
contentUrl (Optional[str]) – should be set to the Portal’s content URL, e.g. https://mysite.com/portal/sharing/rest/content
groupId (Optional[str]) – ID of group to query
authcfg (Optional[str]) – authentication configuration ID
itemTypes (Iterable[int]) – list of desired item types (using
Qgis.ArcGisRestServiceType values)requestHeaders (
QgsHttpHeaders= QgsHttpHeaders()) – optional additional request headersfeedback (Optional[QgsFeedback] = None) – optional feedback argument for cancellation support
pageSize (int = 100) – number of results to retrieve for each request. Maximum value is 100.
urlPrefix (Optional[str] = '') -> (List[Any]) – http web proxy url prefix
- 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
Added in version 3.24.
retrieveGroupItemsOfType(contentUrl: Optional[str], groupId: Optional[str], authcfg: Optional[str], itemTypes: Iterable[int], requestHeaders: Dict[Optional[str], Any], feedback: Optional[QgsFeedback] = None, pageSize: int = 100, urlPrefix: Optional[str] = ‘’) -> (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.
urlPrefix – http web proxy url prefix
- 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 3.24: Use the version with
QgsHttpHeadersinstead.
- static retrieveUserGroups(communityUrl: str | None, user: str | None, authcfg: str | None, requestHeaders: QgsHttpHeaders = QgsHttpHeaders(), feedback: QgsFeedback | None = None, urlPrefix: str | None = '')[source]¶
Retrieves JSON definitions for all groups which the specified user name is a member of.
If
useris blank then the user associated with the current logon details will be retrieved- Parameters:
communityUrl (Optional[str]) – should be set to the Portal’s community URL, e.g. https://mysite.com/portal/sharing/rest/community
user (Optional[str]) – username to query, or an empty string to query the current user
authcfg (Optional[str]) – authentication configuration ID
requestHeaders (
QgsHttpHeaders= QgsHttpHeaders()) – optional additional request headersfeedback (Optional[QgsFeedback] = None) – optional feedback argument for cancellation support
urlPrefix (Optional[str] = '') -> (List[Any]) – http web proxy url prefix
- Returns:
a list of JSON group info
errorTitle: title summary of any encountered errors
errorText: error text of any encountered errors
Added in version 3.24.
retrieveUserGroups(communityUrl: Optional[str], user: Optional[str], authcfg: Optional[str], requestHeaders: Dict[Optional[str], Any], feedback: Optional[QgsFeedback] = None, urlPrefix: Optional[str] = ‘’) -> (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
useris 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
urlPrefix – http web proxy url prefix
- Returns:
a list of JSON group info
errorTitle: title summary of any encountered errors
errorText: error text of any encountered errors
Deprecated since version 3.24: Use the version with
QgsHttpHeadersinstead.
- static retrieveUserInfo(communityUrl: str | None, user: str | None, authcfg: str | None, requestHeaders: QgsHttpHeaders = QgsHttpHeaders(), feedback: QgsFeedback | None = None, urlPrefix: str | None = '')[source]¶
Retrieves JSON user info for the specified user name.
If
useris blank then the user associated with the current logon details will be retrieved- Parameters:
communityUrl (Optional[str]) – should be set to the Portal’s community URL, e.g. https://mysite.com/portal/sharing/rest/community
user (Optional[str]) – username to query, or an empty string to query the current user
authcfg (Optional[str]) – authentication configuration ID
requestHeaders (
QgsHttpHeaders= QgsHttpHeaders()) – optional additional request headersfeedback (Optional[QgsFeedback] = None) – optional feedback argument for cancellation support
urlPrefix (Optional[str] = '') -> (Dict[str, Any]) – http web proxy url prefix
- Returns:
JSON user info
errorTitle: title summary of any encountered errors
errorText: error text of any encountered errors
Added in version 3.24.
retrieveUserInfo(communityUrl: Optional[str], user: Optional[str], authcfg: Optional[str], requestHeaders: Dict[Optional[str], Any], feedback: Optional[QgsFeedback] = None, urlPrefix: Optional[str] = ‘’) -> (Dict[str, Any], str, str) Retrieves JSON user info for the specified user name. Only to avoid API break.
If
useris 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
urlPrefix – http web proxy url prefix
- Returns:
JSON user info
errorTitle: title summary of any encountered errors
errorText: error text of any encountered errors
Deprecated since version 3.24: Use the version with
QgsHttpHeadersinstead.