1. Packages
  2. AzAPI
  3. API Docs
  4. getResourceList
AzAPI v1.12.2 published on Saturday, May 11, 2024 by dirien

azapi.getResourceList

Start a Neo task
Explain and create an azapi.getResourceList resource
azapi logo
AzAPI v1.12.2 published on Saturday, May 11, 2024 by dirien

    This resource can list all resources of a specific type under a scope. If the API supports paging, it will automatically fetch all pages and return the full list.

    Example Usage

    terraform {
      required_providers {
        azapi = {
          source = "Azure/azapi"
        }
      }
    }
    
    provider "azapi" {
    }
    
    data "azapi_resource_list" "listBySubscription" {
      type                   = "Microsoft.Automation/automationAccounts@2021-06-22"
      parent_id              = "/subscriptions/00000000-0000-0000-0000-000000000000"
      response_export_values = ["*"]
    }
    
    data "azapi_resource_list" "listByResourceGroup" {
      type                   = "Microsoft.Automation/automationAccounts@2021-06-22"
      parent_id              = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1"
      response_export_values = ["*"]
    }
    
    data "azapi_resource_list" "listSubnetsByVnet" {
      type                   = "Microsoft.Network/virtualNetworks/subnets@2021-02-01"
      parent_id              = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"
      response_export_values = ["*"]
    }
    

    Using getResourceList

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getResourceList(args: GetResourceListArgs, opts?: InvokeOptions): Promise<GetResourceListResult>
    function getResourceListOutput(args: GetResourceListOutputArgs, opts?: InvokeOptions): Output<GetResourceListResult>
    def get_resource_list(parent_id: Optional[str] = None,
                          response_export_values: Optional[Sequence[str]] = None,
                          type: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetResourceListResult
    def get_resource_list_output(parent_id: Optional[pulumi.Input[str]] = None,
                          response_export_values: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          type: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetResourceListResult]
    func GetResourceList(ctx *Context, args *GetResourceListArgs, opts ...InvokeOption) (*GetResourceListResult, error)
    func GetResourceListOutput(ctx *Context, args *GetResourceListOutputArgs, opts ...InvokeOption) GetResourceListResultOutput

    > Note: This function is named GetResourceList in the Go SDK.

    public static class GetResourceList 
    {
        public static Task<GetResourceListResult> InvokeAsync(GetResourceListArgs args, InvokeOptions? opts = null)
        public static Output<GetResourceListResult> Invoke(GetResourceListInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourceListResult> getResourceList(GetResourceListArgs args, InvokeOptions options)
    public static Output<GetResourceListResult> getResourceList(GetResourceListArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azapi:index/getResourceList:getResourceList
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ParentId string
    The parent resource ID to list resources under. e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup.
    Type string
    It is in a format like <resource-type>@<api-version>. <resource-type> is the Azure resource type, for example, Microsoft.Storage/storageAccounts. <api-version> is version of the API used to manage this azure resource.
    ResponseExportValues List<string>
    A list of path that needs to be exported from response body. Setting it to ["*"] will export the full response body. Here's an example. If it sets to ["value"], it will set the following json to computed property output.

    {
    "value": [
    {
    "id": "id1",
    "Permissions": "Full"
    },
    {
    "id": "id2",
    "Permissions": "Full"
    }
    ]
    }
    
    ParentId string
    The parent resource ID to list resources under. e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup.
    Type string
    It is in a format like <resource-type>@<api-version>. <resource-type> is the Azure resource type, for example, Microsoft.Storage/storageAccounts. <api-version> is version of the API used to manage this azure resource.
    ResponseExportValues []string
    A list of path that needs to be exported from response body. Setting it to ["*"] will export the full response body. Here's an example. If it sets to ["value"], it will set the following json to computed property output.

    {
    "value": [
    {
    "id": "id1",
    "Permissions": "Full"
    },
    {
    "id": "id2",
    "Permissions": "Full"
    }
    ]
    }
    
    parentId String
    The parent resource ID to list resources under. e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup.
    type String
    It is in a format like <resource-type>@<api-version>. <resource-type> is the Azure resource type, for example, Microsoft.Storage/storageAccounts. <api-version> is version of the API used to manage this azure resource.
    responseExportValues List<String>
    A list of path that needs to be exported from response body. Setting it to ["*"] will export the full response body. Here's an example. If it sets to ["value"], it will set the following json to computed property output.

    {
    "value": [
    {
    "id": "id1",
    "Permissions": "Full"
    },
    {
    "id": "id2",
    "Permissions": "Full"
    }
    ]
    }
    
    parentId string
    The parent resource ID to list resources under. e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup.
    type string
    It is in a format like <resource-type>@<api-version>. <resource-type> is the Azure resource type, for example, Microsoft.Storage/storageAccounts. <api-version> is version of the API used to manage this azure resource.
    responseExportValues string[]
    A list of path that needs to be exported from response body. Setting it to ["*"] will export the full response body. Here's an example. If it sets to ["value"], it will set the following json to computed property output.

    {
    "value": [
    {
    "id": "id1",
    "Permissions": "Full"
    },
    {
    "id": "id2",
    "Permissions": "Full"
    }
    ]
    }
    
    parent_id str
    The parent resource ID to list resources under. e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup.
    type str
    It is in a format like <resource-type>@<api-version>. <resource-type> is the Azure resource type, for example, Microsoft.Storage/storageAccounts. <api-version> is version of the API used to manage this azure resource.
    response_export_values Sequence[str]
    A list of path that needs to be exported from response body. Setting it to ["*"] will export the full response body. Here's an example. If it sets to ["value"], it will set the following json to computed property output.

    {
    "value": [
    {
    "id": "id1",
    "Permissions": "Full"
    },
    {
    "id": "id2",
    "Permissions": "Full"
    }
    ]
    }
    
    parentId String
    The parent resource ID to list resources under. e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup.
    type String
    It is in a format like <resource-type>@<api-version>. <resource-type> is the Azure resource type, for example, Microsoft.Storage/storageAccounts. <api-version> is version of the API used to manage this azure resource.
    responseExportValues List<String>
    A list of path that needs to be exported from response body. Setting it to ["*"] will export the full response body. Here's an example. If it sets to ["value"], it will set the following json to computed property output.

    {
    "value": [
    {
    "id": "id1",
    "Permissions": "Full"
    },
    {
    "id": "id2",
    "Permissions": "Full"
    }
    ]
    }
    

    getResourceList Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Output string
    The output json containing the properties specified in response_export_values. Here are some examples to decode json and extract the value.
    ParentId string
    Type string
    ResponseExportValues List<string>
    Id string
    The provider-assigned unique ID for this managed resource.
    Output string
    The output json containing the properties specified in response_export_values. Here are some examples to decode json and extract the value.
    ParentId string
    Type string
    ResponseExportValues []string
    id String
    The provider-assigned unique ID for this managed resource.
    output String
    The output json containing the properties specified in response_export_values. Here are some examples to decode json and extract the value.
    parentId String
    type String
    responseExportValues List<String>
    id string
    The provider-assigned unique ID for this managed resource.
    output string
    The output json containing the properties specified in response_export_values. Here are some examples to decode json and extract the value.
    parentId string
    type string
    responseExportValues string[]
    id str
    The provider-assigned unique ID for this managed resource.
    output str
    The output json containing the properties specified in response_export_values. Here are some examples to decode json and extract the value.
    parent_id str
    type str
    response_export_values Sequence[str]
    id String
    The provider-assigned unique ID for this managed resource.
    output String
    The output json containing the properties specified in response_export_values. Here are some examples to decode json and extract the value.
    parentId String
    type String
    responseExportValues List<String>

    Package Details

    Repository
    azapi dirien/pulumi-azapi
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azapi Terraform Provider.
    azapi logo
    AzAPI v1.12.2 published on Saturday, May 11, 2024 by dirien
      Meet Neo: Your AI Platform Teammate