Skip to main content

api_portals

Creates, updates, deletes, gets or lists an api_portals resource.

Overview

Nameapi_portals
TypeResource
Idazure_extras.app_platform.api_portals

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource Id for the resource.
namestringThe name of the resource.
apiTryOutEnabledStatestringIndicates whether the API try-out feature is enabled or disabled. When enabled, users can try out the API by sending requests and viewing responses in API portal. When disabled, users cannot try out the API. Known values are: "Enabled" and "Disabled".
gatewayIdsarrayThe array of resource Ids of gateway to integrate with API portal.
httpsOnlybooleanIndicate if only https is allowed.
instancesarrayCollection of instances belong to API portal.
provisioningStatestringState of the API portal. Known values are: "Creating", "Updating", "Succeeded", "Failed", and "Deleting".
publicbooleanIndicates whether the API portal exposes endpoint.
resourceRequestsobjectThe requested resource quantity for required CPU and Memory.
skuobjectSku of the API portal resource.
sourceUrlsarrayCollection of OpenAPI source URL locations.
ssoPropertiesobjectSingle sign-on related configuration.
systemDataobjectMetadata pertaining to creation and last modification of the resource.
typestringThe type of the resource.
urlstringURL of the API portal, exposed when 'public' is true.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, service_name, api_portal_name, subscription_idGet the API portal and its properties.
listselectresource_group_name, service_name, subscription_idHandles requests to list all resources in a Service.
create_or_updateinsertresource_group_name, service_name, api_portal_name, subscription_idCreate the default API portal or update the existing API portal.
create_or_updatereplaceresource_group_name, service_name, api_portal_name, subscription_idCreate the default API portal or update the existing API portal.
deletedeleteresource_group_name, service_name, api_portal_name, subscription_idDelete the default API portal.
validate_domainexecresource_group_name, service_name, api_portal_name, subscription_id, nameCheck the domains are valid as well as not in use.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_portal_namestringThe name of API portal. Required.
resource_group_namestringThe name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. Required.
service_namestringThe name of the Service resource. Required.
subscription_idstring

SELECT examples

Get the API portal and its properties.

SELECT
id,
name,
apiTryOutEnabledState,
gatewayIds,
httpsOnly,
instances,
provisioningState,
public,
resourceRequests,
sku,
sourceUrls,
ssoProperties,
systemData,
type,
url
FROM azure_extras.app_platform.api_portals
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND api_portal_name = '{{ api_portal_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create the default API portal or update the existing API portal.

INSERT INTO azure_extras.app_platform.api_portals (
properties,
sku,
resource_group_name,
service_name,
api_portal_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ sku }}',
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ api_portal_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
sku,
systemData,
type
;

REPLACE examples

Create the default API portal or update the existing API portal.

REPLACE azure_extras.app_platform.api_portals
SET
properties = '{{ properties }}',
sku = '{{ sku }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_portal_name = '{{ api_portal_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
sku,
systemData,
type;

DELETE examples

Delete the default API portal.

DELETE FROM azure_extras.app_platform.api_portals
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_portal_name = '{{ api_portal_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Check the domains are valid as well as not in use.

EXEC azure_extras.app_platform.api_portals.validate_domain 
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@api_portal_name='{{ api_portal_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"name": "{{ name }}"
}'
;