getRestApi

Use this data source to retrieve information about a GitHub resource through REST API.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.GithubFunctions;
import com.pulumi.github.inputs.GetRestApiArgs;
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) {
final var example = GithubFunctions.getRestApi(GetRestApiArgs.builder()
.endpoint("repos/example_repo/git/refs/heads/main")
.build());
}
}

Return

A collection of values returned by getRestApi.

Parameters

argument

A collection of arguments for invoking getRestApi.


suspend fun getRestApi(endpoint: String): GetRestApiResult

Return

A collection of values returned by getRestApi.

Parameters

endpoint

REST API endpoint to send the GET request to.

See also


suspend fun getRestApi(argument: suspend GetRestApiPlainArgsBuilder.() -> Unit): GetRestApiResult

Return

A collection of values returned by getRestApi.

Parameters

argument

Builder for com.pulumi.github.kotlin.inputs.GetRestApiPlainArgs.

See also