1. Packages
  2. Sumo Logic
  3. API Docs
  4. Content
Sumo Logic v0.22.1 published on Sunday, Jun 9, 2024 by Pulumi

sumologic.Content

Explore with Pulumi AI

sumologic logo
Sumo Logic v0.22.1 published on Sunday, Jun 9, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as sumologic from "@pulumi/sumologic";
    
    const personalFolder = sumologic.getPersonalFolder({});
    const test = new sumologic.Content("test", {
        parentId: personalFolder.then(personalFolder => personalFolder.id),
        config: JSON.stringify({
            type: "SavedSearchWithScheduleSyncDefinition",
            name: "test-333",
            search: {
                queryText: "\"warn\"",
                defaultTimeRange: "-15m",
                byReceiptTime: false,
                viewName: "",
                viewStartTime: "1970-01-01T00:00:00Z",
                queryParameters: [],
                parsingMode: "Manual",
            },
            searchSchedule: {
                cronExpression: "0 0 * * * ? *",
                displayableTimeRange: "-10m",
                parseableTimeRange: {
                    type: "BeginBoundedTimeRange",
                    from: {
                        type: "RelativeTimeRangeBoundary",
                        relativeTime: "-50m",
                    },
                    to: undefined,
                },
                timeZone: "America/Los_Angeles",
                threshold: {
                    operator: "gt",
                    count: 0,
                },
                notification: {
                    taskType: "EmailSearchNotificationSyncDefinition",
                    toList: ["ops@acme.org"],
                    subjectTemplate: "Search Results: {{Name}}",
                    includeQuery: true,
                    includeResultSet: true,
                    includeHistogram: false,
                    includeCsvAttachment: false,
                },
                scheduleType: "1Hour",
                muteErrorEmails: false,
                parameters: [],
            },
            description: "Runs every hour with timerange of 15m and sends email notifications",
        }),
    });
    
    import pulumi
    import json
    import pulumi_sumologic as sumologic
    
    personal_folder = sumologic.get_personal_folder()
    test = sumologic.Content("test",
        parent_id=personal_folder.id,
        config=json.dumps({
            "type": "SavedSearchWithScheduleSyncDefinition",
            "name": "test-333",
            "search": {
                "queryText": "\"warn\"",
                "defaultTimeRange": "-15m",
                "byReceiptTime": False,
                "viewName": "",
                "viewStartTime": "1970-01-01T00:00:00Z",
                "queryParameters": [],
                "parsingMode": "Manual",
            },
            "searchSchedule": {
                "cronExpression": "0 0 * * * ? *",
                "displayableTimeRange": "-10m",
                "parseableTimeRange": {
                    "type": "BeginBoundedTimeRange",
                    "from": {
                        "type": "RelativeTimeRangeBoundary",
                        "relativeTime": "-50m",
                    },
                    "to": None,
                },
                "timeZone": "America/Los_Angeles",
                "threshold": {
                    "operator": "gt",
                    "count": 0,
                },
                "notification": {
                    "taskType": "EmailSearchNotificationSyncDefinition",
                    "toList": ["ops@acme.org"],
                    "subjectTemplate": "Search Results: {{Name}}",
                    "includeQuery": True,
                    "includeResultSet": True,
                    "includeHistogram": False,
                    "includeCsvAttachment": False,
                },
                "scheduleType": "1Hour",
                "muteErrorEmails": False,
                "parameters": [],
            },
            "description": "Runs every hour with timerange of 15m and sends email notifications",
        }))
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-sumologic/sdk/go/sumologic"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		personalFolder, err := sumologic.GetPersonalFolder(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"type": "SavedSearchWithScheduleSyncDefinition",
    			"name": "test-333",
    			"search": map[string]interface{}{
    				"queryText":        "\"warn\"",
    				"defaultTimeRange": "-15m",
    				"byReceiptTime":    false,
    				"viewName":         "",
    				"viewStartTime":    "1970-01-01T00:00:00Z",
    				"queryParameters":  []interface{}{},
    				"parsingMode":      "Manual",
    			},
    			"searchSchedule": map[string]interface{}{
    				"cronExpression":       "0 0 * * * ? *",
    				"displayableTimeRange": "-10m",
    				"parseableTimeRange": map[string]interface{}{
    					"type": "BeginBoundedTimeRange",
    					"from": map[string]interface{}{
    						"type":         "RelativeTimeRangeBoundary",
    						"relativeTime": "-50m",
    					},
    					"to": nil,
    				},
    				"timeZone": "America/Los_Angeles",
    				"threshold": map[string]interface{}{
    					"operator": "gt",
    					"count":    0,
    				},
    				"notification": map[string]interface{}{
    					"taskType": "EmailSearchNotificationSyncDefinition",
    					"toList": []string{
    						"ops@acme.org",
    					},
    					"subjectTemplate":      "Search Results: {{Name}}",
    					"includeQuery":         true,
    					"includeResultSet":     true,
    					"includeHistogram":     false,
    					"includeCsvAttachment": false,
    				},
    				"scheduleType":    "1Hour",
    				"muteErrorEmails": false,
    				"parameters":      []interface{}{},
    			},
    			"description": "Runs every hour with timerange of 15m and sends email notifications",
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = sumologic.NewContent(ctx, "test", &sumologic.ContentArgs{
    			ParentId: pulumi.String(personalFolder.Id),
    			Config:   pulumi.String(json0),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using SumoLogic = Pulumi.SumoLogic;
    
    return await Deployment.RunAsync(() => 
    {
        var personalFolder = SumoLogic.GetPersonalFolder.Invoke();
    
        var test = new SumoLogic.Content("test", new()
        {
            ParentId = personalFolder.Apply(getPersonalFolderResult => getPersonalFolderResult.Id),
            Config = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["type"] = "SavedSearchWithScheduleSyncDefinition",
                ["name"] = "test-333",
                ["search"] = new Dictionary<string, object?>
                {
                    ["queryText"] = "\"warn\"",
                    ["defaultTimeRange"] = "-15m",
                    ["byReceiptTime"] = false,
                    ["viewName"] = "",
                    ["viewStartTime"] = "1970-01-01T00:00:00Z",
                    ["queryParameters"] = new[]
                    {
                    },
                    ["parsingMode"] = "Manual",
                },
                ["searchSchedule"] = new Dictionary<string, object?>
                {
                    ["cronExpression"] = "0 0 * * * ? *",
                    ["displayableTimeRange"] = "-10m",
                    ["parseableTimeRange"] = new Dictionary<string, object?>
                    {
                        ["type"] = "BeginBoundedTimeRange",
                        ["from"] = new Dictionary<string, object?>
                        {
                            ["type"] = "RelativeTimeRangeBoundary",
                            ["relativeTime"] = "-50m",
                        },
                        ["to"] = null,
                    },
                    ["timeZone"] = "America/Los_Angeles",
                    ["threshold"] = new Dictionary<string, object?>
                    {
                        ["operator"] = "gt",
                        ["count"] = 0,
                    },
                    ["notification"] = new Dictionary<string, object?>
                    {
                        ["taskType"] = "EmailSearchNotificationSyncDefinition",
                        ["toList"] = new[]
                        {
                            "ops@acme.org",
                        },
                        ["subjectTemplate"] = "Search Results: {{Name}}",
                        ["includeQuery"] = true,
                        ["includeResultSet"] = true,
                        ["includeHistogram"] = false,
                        ["includeCsvAttachment"] = false,
                    },
                    ["scheduleType"] = "1Hour",
                    ["muteErrorEmails"] = false,
                    ["parameters"] = new[]
                    {
                    },
                },
                ["description"] = "Runs every hour with timerange of 15m and sends email notifications",
            }),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sumologic.SumologicFunctions;
    import com.pulumi.sumologic.inputs.GetPersonalFolderArgs;
    import com.pulumi.sumologic.Content;
    import com.pulumi.sumologic.ContentArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 personalFolder = SumologicFunctions.getPersonalFolder();
    
            var test = new Content("test", ContentArgs.builder()
                .parentId(personalFolder.applyValue(getPersonalFolderResult -> getPersonalFolderResult.id()))
                .config(serializeJson(
                    jsonObject(
                        jsonProperty("type", "SavedSearchWithScheduleSyncDefinition"),
                        jsonProperty("name", "test-333"),
                        jsonProperty("search", jsonObject(
                            jsonProperty("queryText", "\"warn\""),
                            jsonProperty("defaultTimeRange", "-15m"),
                            jsonProperty("byReceiptTime", false),
                            jsonProperty("viewName", ""),
                            jsonProperty("viewStartTime", "1970-01-01T00:00:00Z"),
                            jsonProperty("queryParameters", jsonArray(
                            )),
                            jsonProperty("parsingMode", "Manual")
                        )),
                        jsonProperty("searchSchedule", jsonObject(
                            jsonProperty("cronExpression", "0 0 * * * ? *"),
                            jsonProperty("displayableTimeRange", "-10m"),
                            jsonProperty("parseableTimeRange", jsonObject(
                                jsonProperty("type", "BeginBoundedTimeRange"),
                                jsonProperty("from", jsonObject(
                                    jsonProperty("type", "RelativeTimeRangeBoundary"),
                                    jsonProperty("relativeTime", "-50m")
                                )),
                                jsonProperty("to", null)
                            )),
                            jsonProperty("timeZone", "America/Los_Angeles"),
                            jsonProperty("threshold", jsonObject(
                                jsonProperty("operator", "gt"),
                                jsonProperty("count", 0)
                            )),
                            jsonProperty("notification", jsonObject(
                                jsonProperty("taskType", "EmailSearchNotificationSyncDefinition"),
                                jsonProperty("toList", jsonArray("ops@acme.org")),
                                jsonProperty("subjectTemplate", "Search Results: {{Name}}"),
                                jsonProperty("includeQuery", true),
                                jsonProperty("includeResultSet", true),
                                jsonProperty("includeHistogram", false),
                                jsonProperty("includeCsvAttachment", false)
                            )),
                            jsonProperty("scheduleType", "1Hour"),
                            jsonProperty("muteErrorEmails", false),
                            jsonProperty("parameters", jsonArray(
                            ))
                        )),
                        jsonProperty("description", "Runs every hour with timerange of 15m and sends email notifications")
                    )))
                .build());
    
        }
    }
    
    resources:
      test:
        type: sumologic:Content
        properties:
          parentId: ${personalFolder.id}
          config:
            fn::toJSON:
              type: SavedSearchWithScheduleSyncDefinition
              name: test-333
              search:
                queryText: '"warn"'
                defaultTimeRange: -15m
                byReceiptTime: false
                viewName:
                viewStartTime: 1970-01-01T00:00:00Z
                queryParameters: []
                parsingMode: Manual
              searchSchedule:
                cronExpression: 0 0 * * * ? *
                displayableTimeRange: -10m
                parseableTimeRange:
                  type: BeginBoundedTimeRange
                  from:
                    type: RelativeTimeRangeBoundary
                    relativeTime: -50m
                  to: null
                timeZone: America/Los_Angeles
                threshold:
                  operator: gt
                  count: 0
                notification:
                  taskType: EmailSearchNotificationSyncDefinition
                  toList:
                    - ops@acme.org
                  subjectTemplate: 'Search Results: {{Name}}'
                  includeQuery: true
                  includeResultSet: true
                  includeHistogram: false
                  includeCsvAttachment: false
                scheduleType: 1Hour
                muteErrorEmails: false
                parameters: []
              description: Runs every hour with timerange of 15m and sends email notifications
    variables:
      personalFolder:
        fn::invoke:
          Function: sumologic:getPersonalFolder
          Arguments: {}
    

    Attributes reference

    The following attributes are exported:

    • id - Unique identifier for the content item.

    Create Content Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Content(name: string, args: ContentArgs, opts?: CustomResourceOptions);
    @overload
    def Content(resource_name: str,
                args: ContentArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Content(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                config: Optional[str] = None,
                parent_id: Optional[str] = None)
    func NewContent(ctx *Context, name string, args ContentArgs, opts ...ResourceOption) (*Content, error)
    public Content(string name, ContentArgs args, CustomResourceOptions? opts = null)
    public Content(String name, ContentArgs args)
    public Content(String name, ContentArgs args, CustomResourceOptions options)
    
    type: sumologic:Content
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ContentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ContentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ContentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ContentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ContentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var contentResource = new SumoLogic.Content("contentResource", new()
    {
        Config = "string",
        ParentId = "string",
    });
    
    example, err := sumologic.NewContent(ctx, "contentResource", &sumologic.ContentArgs{
    	Config:   pulumi.String("string"),
    	ParentId: pulumi.String("string"),
    })
    
    var contentResource = new Content("contentResource", ContentArgs.builder()
        .config("string")
        .parentId("string")
        .build());
    
    content_resource = sumologic.Content("contentResource",
        config="string",
        parent_id="string")
    
    const contentResource = new sumologic.Content("contentResource", {
        config: "string",
        parentId: "string",
    });
    
    type: sumologic:Content
    properties:
        config: string
        parentId: string
    

    Content Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Content resource accepts the following input properties:

    Config string
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    ParentId string
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    Config string
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    ParentId string
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    config String
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    parentId String
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    config string
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    parentId string
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    config str
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    parent_id str
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    config String
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    parentId String
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Content resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Content Resource

    Get an existing Content resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ContentState, opts?: CustomResourceOptions): Content
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            config: Optional[str] = None,
            parent_id: Optional[str] = None) -> Content
    func GetContent(ctx *Context, name string, id IDInput, state *ContentState, opts ...ResourceOption) (*Content, error)
    public static Content Get(string name, Input<string> id, ContentState? state, CustomResourceOptions? opts = null)
    public static Content get(String name, Output<String> id, ContentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Config string
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    ParentId string
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    Config string
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    ParentId string
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    config String
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    parentId String
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    config string
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    parentId string
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    config str
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    parent_id str
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.
    config String
    JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).
    parentId String
    The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

    Package Details

    Repository
    Sumo Logic pulumi/pulumi-sumologic
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the sumologic Terraform Provider.
    sumologic logo
    Sumo Logic v0.22.1 published on Sunday, Jun 9, 2024 by Pulumi