Oracle Cloud Infrastructure

Pulumi Official
Package maintained by Pulumi
v0.1.1 published on Tuesday, May 3, 2022 by Pulumi

getLogs

This data source provides the list of Logs in Oracle Cloud Infrastructure Logging service.

Lists the specified log group’s log objects.

Example Usage

using Pulumi;
using Oci = Pulumi.Oci;

class MyStack : Stack
{
    public MyStack()
    {
        var testLogs = Output.Create(Oci.Logging.GetLogs.InvokeAsync(new Oci.Logging.GetLogsArgs
        {
            LogGroupId = oci_logging_log_group.Test_log_group.Id,
            DisplayName = @var.Log_display_name,
            LogType = @var.Log_log_type,
            SourceResource = @var.Log_source_resource,
            SourceService = @var.Log_source_service,
            State = @var.Log_state,
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Logging.GetLogs(ctx, &logging.GetLogsArgs{
			LogGroupId:     oci_logging_log_group.Test_log_group.Id,
			DisplayName:    pulumi.StringRef(_var.Log_display_name),
			LogType:        pulumi.StringRef(_var.Log_log_type),
			SourceResource: pulumi.StringRef(_var.Log_source_resource),
			SourceService:  pulumi.StringRef(_var.Log_source_service),
			State:          pulumi.StringRef(_var.Log_state),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_oci as oci

test_logs = oci.Logging.get_logs(log_group_id=oci_logging_log_group["test_log_group"]["id"],
    display_name=var["log_display_name"],
    log_type=var["log_log_type"],
    source_resource=var["log_source_resource"],
    source_service=var["log_source_service"],
    state=var["log_state"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testLogs = oci.Logging.getLogs({
    logGroupId: oci_logging_log_group.test_log_group.id,
    displayName: _var.log_display_name,
    logType: _var.log_log_type,
    sourceResource: _var.log_source_resource,
    sourceService: _var.log_source_service,
    state: _var.log_state,
});

Coming soon!

Using getLogs

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 getLogs(args: GetLogsArgs, opts?: InvokeOptions): Promise<GetLogsResult>
function getLogsOutput(args: GetLogsOutputArgs, opts?: InvokeOptions): Output<GetLogsResult>
def get_logs(display_name: Optional[str] = None,
             filters: Optional[Sequence[_logging.GetLogsFilter]] = None,
             log_group_id: Optional[str] = None,
             log_type: Optional[str] = None,
             source_resource: Optional[str] = None,
             source_service: Optional[str] = None,
             state: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetLogsResult
def get_logs_output(display_name: Optional[pulumi.Input[str]] = None,
             filters: Optional[pulumi.Input[Sequence[pulumi.Input[_logging.GetLogsFilterArgs]]]] = None,
             log_group_id: Optional[pulumi.Input[str]] = None,
             log_type: Optional[pulumi.Input[str]] = None,
             source_resource: Optional[pulumi.Input[str]] = None,
             source_service: Optional[pulumi.Input[str]] = None,
             state: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetLogsResult]
func GetLogs(ctx *Context, args *GetLogsArgs, opts ...InvokeOption) (*GetLogsResult, error)
func GetLogsOutput(ctx *Context, args *GetLogsOutputArgs, opts ...InvokeOption) GetLogsResultOutput

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

public static class GetLogs 
{
    public static Task<GetLogsResult> InvokeAsync(GetLogsArgs args, InvokeOptions? opts = null)
    public static Output<GetLogsResult> Invoke(GetLogsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLogsResult> getLogs(GetLogsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: oci:Logging/getLogs:getLogs
  Arguments:
    # Arguments dictionary

The following arguments are supported:

LogGroupId string

OCID of a log group to work with.

DisplayName string

Resource name

Filters List<GetLogsFilter>
LogType string

The logType that the log object is for, whether custom or service.

SourceResource string

Log object resource.

SourceService string

Service that created the log object.

State string

Lifecycle state of the log object

LogGroupId string

OCID of a log group to work with.

DisplayName string

Resource name

Filters []GetLogsFilter
LogType string

The logType that the log object is for, whether custom or service.

SourceResource string

Log object resource.

SourceService string

Service that created the log object.

State string

Lifecycle state of the log object

logGroupId String

OCID of a log group to work with.

displayName String

Resource name

filters List<GetLogsFilter>
logType String

The logType that the log object is for, whether custom or service.

sourceResource String

Log object resource.

sourceService String

Service that created the log object.

state String

Lifecycle state of the log object

logGroupId string

OCID of a log group to work with.

displayName string

Resource name

filters GetLogsFilter[]
logType string

The logType that the log object is for, whether custom or service.

sourceResource string

Log object resource.

sourceService string

Service that created the log object.

state string

Lifecycle state of the log object

log_group_id str

OCID of a log group to work with.

display_name str

Resource name

filters GetLogsFilter]
log_type str

The logType that the log object is for, whether custom or service.

source_resource str

Log object resource.

source_service str

Service that created the log object.

state str

Lifecycle state of the log object

logGroupId String

OCID of a log group to work with.

displayName String

Resource name

filters List<Property Map>
logType String

The logType that the log object is for, whether custom or service.

sourceResource String

Log object resource.

sourceService String

Service that created the log object.

state String

Lifecycle state of the log object

getLogs Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

LogGroupId string

Log group OCID.

Logs List<GetLogsLog>

The list of logs.

DisplayName string

The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.

Filters List<GetLogsFilter>
LogType string

The logType that the log object is for, whether custom or service.

SourceResource string
SourceService string
State string

The pipeline state.

Id string

The provider-assigned unique ID for this managed resource.

LogGroupId string

Log group OCID.

Logs []GetLogsLog

The list of logs.

DisplayName string

The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.

Filters []GetLogsFilter
LogType string

The logType that the log object is for, whether custom or service.

SourceResource string
SourceService string
State string

The pipeline state.

id String

The provider-assigned unique ID for this managed resource.

logGroupId String

Log group OCID.

logs List<GetLogsLog>

The list of logs.

displayName String

The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.

filters List<GetLogsFilter>
logType String

The logType that the log object is for, whether custom or service.

sourceResource String
sourceService String
state String

The pipeline state.

id string

The provider-assigned unique ID for this managed resource.

logGroupId string

Log group OCID.

logs GetLogsLog[]

The list of logs.

displayName string

The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.

filters GetLogsFilter[]
logType string

The logType that the log object is for, whether custom or service.

sourceResource string
sourceService string
state string

The pipeline state.

id str

The provider-assigned unique ID for this managed resource.

log_group_id str

Log group OCID.

logs GetLogsLog]

The list of logs.

display_name str

The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.

filters GetLogsFilter]
log_type str

The logType that the log object is for, whether custom or service.

source_resource str
source_service str
state str

The pipeline state.

id String

The provider-assigned unique ID for this managed resource.

logGroupId String

Log group OCID.

logs List<Property Map>

The list of logs.

displayName String

The user-friendly display name. This must be unique within the enclosing resource, and it's changeable. Avoid entering confidential information.

filters List<Property Map>
logType String

The logType that the log object is for, whether custom or service.

sourceResource String
sourceService String
state String

The pipeline state.

Supporting Types

GetLogsFilter

Name string
Values List<string>
Regex bool
Name string
Values []string
Regex bool
name String
values List<String>
regex Boolean
name string
values string[]
regex boolean
name str
values Sequence[str]
regex bool
name String
values List<String>
regex Boolean

GetLogsLog

CompartmentId string

The OCID of the compartment that the resource belongs to.

Configurations List<GetLogsLogConfiguration>

Log object configuration.

DefinedTags Dictionary<string, object>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

DisplayName string

Resource name

FreeformTags Dictionary<string, object>

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. Example: {"Department": "Finance"}

Id string

The OCID of the resource.

IsEnabled bool

Whether or not this resource is currently enabled.

LogGroupId string

OCID of a log group to work with.

LogType string

The logType that the log object is for, whether custom or service.

RetentionDuration int

Log retention duration in 30-day increments (30, 60, 90 and so on).

State string

Lifecycle state of the log object

TenancyId string

The OCID of the tenancy.

TimeCreated string

Time the resource was created.

TimeLastModified string

Time the resource was last modified.

CompartmentId string

The OCID of the compartment that the resource belongs to.

Configurations []GetLogsLogConfiguration

Log object configuration.

DefinedTags map[string]interface{}

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

DisplayName string

Resource name

FreeformTags map[string]interface{}

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. Example: {"Department": "Finance"}

Id string

The OCID of the resource.

IsEnabled bool

Whether or not this resource is currently enabled.

LogGroupId string

OCID of a log group to work with.

LogType string

The logType that the log object is for, whether custom or service.

RetentionDuration int

Log retention duration in 30-day increments (30, 60, 90 and so on).

State string

Lifecycle state of the log object

TenancyId string

The OCID of the tenancy.

TimeCreated string

Time the resource was created.

TimeLastModified string

Time the resource was last modified.

compartmentId String

The OCID of the compartment that the resource belongs to.

configurations List<GetLogsLogConfiguration>

Log object configuration.

definedTags Map<String,Object>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

displayName String

Resource name

freeformTags Map<String,Object>

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. Example: {"Department": "Finance"}

id String

The OCID of the resource.

isEnabled Boolean

Whether or not this resource is currently enabled.

logGroupId String

OCID of a log group to work with.

logType String

The logType that the log object is for, whether custom or service.

retentionDuration Integer

Log retention duration in 30-day increments (30, 60, 90 and so on).

state String

Lifecycle state of the log object

tenancyId String

The OCID of the tenancy.

timeCreated String

Time the resource was created.

timeLastModified String

Time the resource was last modified.

compartmentId string

The OCID of the compartment that the resource belongs to.

configurations GetLogsLogConfiguration[]

Log object configuration.

definedTags {[key: string]: any}

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

displayName string

Resource name

freeformTags {[key: string]: any}

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. Example: {"Department": "Finance"}

id string

The OCID of the resource.

isEnabled boolean

Whether or not this resource is currently enabled.

logGroupId string

OCID of a log group to work with.

logType string

The logType that the log object is for, whether custom or service.

retentionDuration number

Log retention duration in 30-day increments (30, 60, 90 and so on).

state string

Lifecycle state of the log object

tenancyId string

The OCID of the tenancy.

timeCreated string

Time the resource was created.

timeLastModified string

Time the resource was last modified.

compartment_id str

The OCID of the compartment that the resource belongs to.

configurations GetLogsLogConfiguration]

Log object configuration.

defined_tags Mapping[str, Any]

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

display_name str

Resource name

freeform_tags Mapping[str, Any]

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. Example: {"Department": "Finance"}

id str

The OCID of the resource.

is_enabled bool

Whether or not this resource is currently enabled.

log_group_id str

OCID of a log group to work with.

log_type str

The logType that the log object is for, whether custom or service.

retention_duration int

Log retention duration in 30-day increments (30, 60, 90 and so on).

state str

Lifecycle state of the log object

tenancy_id str

The OCID of the tenancy.

time_created str

Time the resource was created.

time_last_modified str

Time the resource was last modified.

compartmentId String

The OCID of the compartment that the resource belongs to.

configurations List<Property Map>

Log object configuration.

definedTags Map<Any>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}

displayName String

Resource name

freeformTags Map<Any>

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. Example: {"Department": "Finance"}

id String

The OCID of the resource.

isEnabled Boolean

Whether or not this resource is currently enabled.

logGroupId String

OCID of a log group to work with.

logType String

The logType that the log object is for, whether custom or service.

retentionDuration Number

Log retention duration in 30-day increments (30, 60, 90 and so on).

state String

Lifecycle state of the log object

tenancyId String

The OCID of the tenancy.

timeCreated String

Time the resource was created.

timeLastModified String

Time the resource was last modified.

GetLogsLogConfiguration

CompartmentId string

The OCID of the compartment that the resource belongs to.

Sources List<GetLogsLogConfigurationSource>

The source the log object comes from.

CompartmentId string

The OCID of the compartment that the resource belongs to.

Sources []GetLogsLogConfigurationSource

The source the log object comes from.

compartmentId String

The OCID of the compartment that the resource belongs to.

sources List<GetLogsLogConfigurationSource>

The source the log object comes from.

compartmentId string

The OCID of the compartment that the resource belongs to.

sources GetLogsLogConfigurationSource[]

The source the log object comes from.

compartment_id str

The OCID of the compartment that the resource belongs to.

sources GetLogsLogConfigurationSource]

The source the log object comes from.

compartmentId String

The OCID of the compartment that the resource belongs to.

sources List<Property Map>

The source the log object comes from.

GetLogsLogConfigurationSource

Category string

Log object category.

Resource string

The unique identifier of the resource emitting the log.

Service string

Service generating log.

SourceType string

The log source.

  • OCISERVICE: Oracle Service.
Category string

Log object category.

Resource string

The unique identifier of the resource emitting the log.

Service string

Service generating log.

SourceType string

The log source.

  • OCISERVICE: Oracle Service.
category String

Log object category.

resource String

The unique identifier of the resource emitting the log.

service String

Service generating log.

sourceType String

The log source.

  • OCISERVICE: Oracle Service.
category string

Log object category.

resource string

The unique identifier of the resource emitting the log.

service string

Service generating log.

sourceType string

The log source.

  • OCISERVICE: Oracle Service.
category str

Log object category.

resource str

The unique identifier of the resource emitting the log.

service str

Service generating log.

source_type str

The log source.

  • OCISERVICE: Oracle Service.
category String

Log object category.

resource String

The unique identifier of the resource emitting the log.

service String

Service generating log.

sourceType String

The log source.

  • OCISERVICE: Oracle Service.

Package Details

Repository
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.