azapi.getResourceAction

Explore with Pulumi AI

This resource can perform resource action which gets information from an existing resource. It’s recommended to use azapi.ResourceAction data source to perform readonly action, please use azapi.ResourceAction resource, if user wants to perform actions which change a resource’s state.

Using getResourceAction

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 getResourceAction(args: GetResourceActionArgs, opts?: InvokeOptions): Promise<GetResourceActionResult>
function getResourceActionOutput(args: GetResourceActionOutputArgs, opts?: InvokeOptions): Output<GetResourceActionResult>
def get_resource_action(action: Optional[str] = None,
                        body: Optional[str] = None,
                        method: Optional[str] = None,
                        resource_id: Optional[str] = None,
                        response_export_values: Optional[Sequence[str]] = None,
                        type: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetResourceActionResult
def get_resource_action_output(action: Optional[pulumi.Input[str]] = None,
                        body: Optional[pulumi.Input[str]] = None,
                        method: Optional[pulumi.Input[str]] = None,
                        resource_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[GetResourceActionResult]
func LookupResourceAction(ctx *Context, args *LookupResourceActionArgs, opts ...InvokeOption) (*LookupResourceActionResult, error)
func LookupResourceActionOutput(ctx *Context, args *LookupResourceActionOutputArgs, opts ...InvokeOption) LookupResourceActionResultOutput

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

public static class GetResourceAction 
{
    public static Task<GetResourceActionResult> InvokeAsync(GetResourceActionArgs args, InvokeOptions? opts = null)
    public static Output<GetResourceActionResult> Invoke(GetResourceActionInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetResourceActionResult> getResourceAction(GetResourceActionArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: azapi:index/getResourceAction:getResourceAction
  arguments:
    # arguments dictionary

The following arguments are supported:

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.

Action string

The name of the resource action. It's also possible to make Http requests towards the resource ID if leave this field empty.

Body string

A JSON object that contains the request body.

Method string

Specifies the Http method of the azure resource action. Allowed values are POST and GET. Defaults to POST.

ResourceId string

The ID of an existing azure source.

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 ["keys"], it will set the following json to computed property output.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
    }
}
{}
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.

Action string

The name of the resource action. It's also possible to make Http requests towards the resource ID if leave this field empty.

Body string

A JSON object that contains the request body.

Method string

Specifies the Http method of the azure resource action. Allowed values are POST and GET. Defaults to POST.

ResourceId string

The ID of an existing azure source.

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 ["keys"], it will set the following json to computed property output.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
    }
}
{}
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.

action String

The name of the resource action. It's also possible to make Http requests towards the resource ID if leave this field empty.

body String

A JSON object that contains the request body.

method String

Specifies the Http method of the azure resource action. Allowed values are POST and GET. Defaults to POST.

resourceId String

The ID of an existing azure source.

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 ["keys"], it will set the following json to computed property output.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
    }
}
{}
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.

action string

The name of the resource action. It's also possible to make Http requests towards the resource ID if leave this field empty.

body string

A JSON object that contains the request body.

method string

Specifies the Http method of the azure resource action. Allowed values are POST and GET. Defaults to POST.

resourceId string

The ID of an existing azure source.

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 ["keys"], it will set the following json to computed property output.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
    }
}
{}
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.

action str

The name of the resource action. It's also possible to make Http requests towards the resource ID if leave this field empty.

body str

A JSON object that contains the request body.

method str

Specifies the Http method of the azure resource action. Allowed values are POST and GET. Defaults to POST.

resource_id str

The ID of an existing azure source.

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 ["keys"], it will set the following json to computed property output.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
    }
}
{}
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.

action String

The name of the resource action. It's also possible to make Http requests towards the resource ID if leave this field empty.

body String

A JSON object that contains the request body.

method String

Specifies the Http method of the azure resource action. Allowed values are POST and GET. Defaults to POST.

resourceId String

The ID of an existing azure source.

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 ["keys"], it will set the following json to computed property output.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
    }
}
{}

getResourceAction 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.

Type string
Action string
Body string
Method string
ResourceId 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.

Type string
Action string
Body string
Method string
ResourceId 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.

type String
action String
body String
method String
resourceId 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.

type string
action string
body string
method string
resourceId 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.

type str
action str
body str
method str
resource_id 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.

type String
action String
body String
method String
resourceId 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.