1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Dns
  5. getViews
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

oci.Dns.getViews

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

This data source provides the list of Views in Oracle Cloud Infrastructure DNS service.

Gets a list of all views within a compartment.

The collection can be filtered by display name, id, or lifecycle state. It can be sorted on creation time or displayName both in ASC or DESC order. Note that when no lifecycleState query parameter is provided, the collection does not include views in the DELETED lifecycleState to be consistent with other operations of the API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testViews = oci.Dns.getViews({
    compartmentId: compartmentId,
    scope: "PRIVATE",
    displayName: viewDisplayName,
    id: viewId,
    state: viewState,
});
Copy
import pulumi
import pulumi_oci as oci

test_views = oci.Dns.get_views(compartment_id=compartment_id,
    scope="PRIVATE",
    display_name=view_display_name,
    id=view_id,
    state=view_state)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/dns"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dns.GetViews(ctx, &dns.GetViewsArgs{
			CompartmentId: compartmentId,
			Scope:         pulumi.StringRef("PRIVATE"),
			DisplayName:   pulumi.StringRef(viewDisplayName),
			Id:            pulumi.StringRef(viewId),
			State:         pulumi.StringRef(viewState),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testViews = Oci.Dns.GetViews.Invoke(new()
    {
        CompartmentId = compartmentId,
        Scope = "PRIVATE",
        DisplayName = viewDisplayName,
        Id = viewId,
        State = viewState,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Dns.DnsFunctions;
import com.pulumi.oci.Dns.inputs.GetViewsArgs;
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 testViews = DnsFunctions.getViews(GetViewsArgs.builder()
            .compartmentId(compartmentId)
            .scope("PRIVATE")
            .displayName(viewDisplayName)
            .id(viewId)
            .state(viewState)
            .build());

    }
}
Copy
variables:
  testViews:
    fn::invoke:
      function: oci:Dns:getViews
      arguments:
        compartmentId: ${compartmentId}
        scope: PRIVATE
        displayName: ${viewDisplayName}
        id: ${viewId}
        state: ${viewState}
Copy

Using getViews

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 getViews(args: GetViewsArgs, opts?: InvokeOptions): Promise<GetViewsResult>
function getViewsOutput(args: GetViewsOutputArgs, opts?: InvokeOptions): Output<GetViewsResult>
Copy
def get_views(compartment_id: Optional[str] = None,
              display_name: Optional[str] = None,
              filters: Optional[Sequence[_dns.GetViewsFilter]] = None,
              id: Optional[str] = None,
              scope: Optional[str] = None,
              state: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetViewsResult
def get_views_output(compartment_id: Optional[pulumi.Input[str]] = None,
              display_name: Optional[pulumi.Input[str]] = None,
              filters: Optional[pulumi.Input[Sequence[pulumi.Input[_dns.GetViewsFilterArgs]]]] = None,
              id: Optional[pulumi.Input[str]] = None,
              scope: Optional[pulumi.Input[str]] = None,
              state: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetViewsResult]
Copy
func GetViews(ctx *Context, args *GetViewsArgs, opts ...InvokeOption) (*GetViewsResult, error)
func GetViewsOutput(ctx *Context, args *GetViewsOutputArgs, opts ...InvokeOption) GetViewsResultOutput
Copy

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

public static class GetViews 
{
    public static Task<GetViewsResult> InvokeAsync(GetViewsArgs args, InvokeOptions? opts = null)
    public static Output<GetViewsResult> Invoke(GetViewsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetViewsResult> getViews(GetViewsArgs args, InvokeOptions options)
public static Output<GetViewsResult> getViews(GetViewsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Dns/getViews:getViews
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The OCID of the compartment the resource belongs to.
DisplayName string
The displayName of a resource.
Filters Changes to this property will trigger replacement. List<GetViewsFilter>
Id string
The OCID of a resource.
Scope string
Value must be PRIVATE when listing private views.
State string
The state of a resource.
CompartmentId This property is required. string
The OCID of the compartment the resource belongs to.
DisplayName string
The displayName of a resource.
Filters Changes to this property will trigger replacement. []GetViewsFilter
Id string
The OCID of a resource.
Scope string
Value must be PRIVATE when listing private views.
State string
The state of a resource.
compartmentId This property is required. String
The OCID of the compartment the resource belongs to.
displayName String
The displayName of a resource.
filters Changes to this property will trigger replacement. List<GetViewsFilter>
id String
The OCID of a resource.
scope String
Value must be PRIVATE when listing private views.
state String
The state of a resource.
compartmentId This property is required. string
The OCID of the compartment the resource belongs to.
displayName string
The displayName of a resource.
filters Changes to this property will trigger replacement. GetViewsFilter[]
id string
The OCID of a resource.
scope string
Value must be PRIVATE when listing private views.
state string
The state of a resource.
compartment_id This property is required. str
The OCID of the compartment the resource belongs to.
display_name str
The displayName of a resource.
filters Changes to this property will trigger replacement. Sequence[dns.GetViewsFilter]
id str
The OCID of a resource.
scope str
Value must be PRIVATE when listing private views.
state str
The state of a resource.
compartmentId This property is required. String
The OCID of the compartment the resource belongs to.
displayName String
The displayName of a resource.
filters Changes to this property will trigger replacement. List<Property Map>
id String
The OCID of a resource.
scope String
Value must be PRIVATE when listing private views.
state String
The state of a resource.

getViews Result

The following output properties are available:

CompartmentId string
The OCID of the owning compartment.
Views List<GetViewsView>
The list of views.
DisplayName string
The display name of the view.
Filters List<GetViewsFilter>
Id string
The OCID of the view.
Scope string
State string
The current state of the resource.
CompartmentId string
The OCID of the owning compartment.
Views []GetViewsView
The list of views.
DisplayName string
The display name of the view.
Filters []GetViewsFilter
Id string
The OCID of the view.
Scope string
State string
The current state of the resource.
compartmentId String
The OCID of the owning compartment.
views List<GetViewsView>
The list of views.
displayName String
The display name of the view.
filters List<GetViewsFilter>
id String
The OCID of the view.
scope String
state String
The current state of the resource.
compartmentId string
The OCID of the owning compartment.
views GetViewsView[]
The list of views.
displayName string
The display name of the view.
filters GetViewsFilter[]
id string
The OCID of the view.
scope string
state string
The current state of the resource.
compartment_id str
The OCID of the owning compartment.
views Sequence[dns.GetViewsView]
The list of views.
display_name str
The display name of the view.
filters Sequence[dns.GetViewsFilter]
id str
The OCID of the view.
scope str
state str
The current state of the resource.
compartmentId String
The OCID of the owning compartment.
views List<Property Map>
The list of views.
displayName String
The display name of the view.
filters List<Property Map>
id String
The OCID of the view.
scope String
state String
The current state of the resource.

Supporting Types

GetViewsFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

GetViewsView

CompartmentId This property is required. string
The OCID of the compartment the resource belongs to.
DefinedTags This property is required. Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
DisplayName This property is required. string
The displayName of a resource.
FreeformTags This property is required. Dictionary<string, string>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.
Id This property is required. string
The OCID of a resource.
IsProtected This property is required. bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
Scope This property is required. string
Value must be PRIVATE when listing private views.
Self This property is required. string
The canonical absolute URL of the resource.
State This property is required. string
The state of a resource.
TimeCreated This property is required. string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
TimeUpdated This property is required. string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
CompartmentId This property is required. string
The OCID of the compartment the resource belongs to.
DefinedTags This property is required. map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
DisplayName This property is required. string
The displayName of a resource.
FreeformTags This property is required. map[string]string
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.
Id This property is required. string
The OCID of a resource.
IsProtected This property is required. bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
Scope This property is required. string
Value must be PRIVATE when listing private views.
Self This property is required. string
The canonical absolute URL of the resource.
State This property is required. string
The state of a resource.
TimeCreated This property is required. string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
TimeUpdated This property is required. string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
compartmentId This property is required. String
The OCID of the compartment the resource belongs to.
definedTags This property is required. Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
displayName This property is required. String
The displayName of a resource.
freeformTags This property is required. Map<String,String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.
id This property is required. String
The OCID of a resource.
isProtected This property is required. Boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
scope This property is required. String
Value must be PRIVATE when listing private views.
self This property is required. String
The canonical absolute URL of the resource.
state This property is required. String
The state of a resource.
timeCreated This property is required. String
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated This property is required. String
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
compartmentId This property is required. string
The OCID of the compartment the resource belongs to.
definedTags This property is required. {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
displayName This property is required. string
The displayName of a resource.
freeformTags This property is required. {[key: string]: string}
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.
id This property is required. string
The OCID of a resource.
isProtected This property is required. boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
scope This property is required. string
Value must be PRIVATE when listing private views.
self This property is required. string
The canonical absolute URL of the resource.
state This property is required. string
The state of a resource.
timeCreated This property is required. string
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated This property is required. string
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
compartment_id This property is required. str
The OCID of the compartment the resource belongs to.
defined_tags This property is required. Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
display_name This property is required. str
The displayName of a resource.
freeform_tags This property is required. Mapping[str, str]
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.
id This property is required. str
The OCID of a resource.
is_protected This property is required. bool
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
scope This property is required. str
Value must be PRIVATE when listing private views.
self This property is required. str
The canonical absolute URL of the resource.
state This property is required. str
The state of a resource.
time_created This property is required. str
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
time_updated This property is required. str
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
compartmentId This property is required. String
The OCID of the compartment the resource belongs to.
definedTags This property is required. Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
displayName This property is required. String
The displayName of a resource.
freeformTags This property is required. Map<String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.
id This property is required. String
The OCID of a resource.
isProtected This property is required. Boolean
A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
scope This property is required. String
Value must be PRIVATE when listing private views.
self This property is required. String
The canonical absolute URL of the resource.
state This property is required. String
The state of a resource.
timeCreated This property is required. String
The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.
timeUpdated This property is required. String
The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ" format with a Z offset, as defined by RFC 3339.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi