1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. aligreen
  5. ImageLib
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.aligreen.ImageLib

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a Aligreen Image Lib resource.

    Image library for image detection.

    For information about Aligreen Image Lib and how to use it, see What is Image Lib.

    NOTE: Available since v1.228.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform";
    const defaultUalunB = new alicloud.aligreen.BizType("defaultUalunB", {bizTypeName: name});
    const _default = new alicloud.aligreen.ImageLib("default", {
        category: "BLACK",
        enable: true,
        scene: "PORN",
        imageLibName: name,
        bizTypes: [defaultUalunB.bizTypeName],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform"
    default_ualun_b = alicloud.aligreen.BizType("defaultUalunB", biz_type_name=name)
    default = alicloud.aligreen.ImageLib("default",
        category="BLACK",
        enable=True,
        scene="PORN",
        image_lib_name=name,
        biz_types=[default_ualun_b.biz_type_name])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/aligreen"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultUalunB, err := aligreen.NewBizType(ctx, "defaultUalunB", &aligreen.BizTypeArgs{
    			BizTypeName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = aligreen.NewImageLib(ctx, "default", &aligreen.ImageLibArgs{
    			Category:     pulumi.String("BLACK"),
    			Enable:       pulumi.Bool(true),
    			Scene:        pulumi.String("PORN"),
    			ImageLibName: pulumi.String(name),
    			BizTypes: pulumi.StringArray{
    				defaultUalunB.BizTypeName,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform";
        var defaultUalunB = new AliCloud.Aligreen.BizType("defaultUalunB", new()
        {
            BizTypeName = name,
        });
    
        var @default = new AliCloud.Aligreen.ImageLib("default", new()
        {
            Category = "BLACK",
            Enable = true,
            Scene = "PORN",
            ImageLibName = name,
            BizTypes = new[]
            {
                defaultUalunB.BizTypeName,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.aligreen.BizType;
    import com.pulumi.alicloud.aligreen.BizTypeArgs;
    import com.pulumi.alicloud.aligreen.ImageLib;
    import com.pulumi.alicloud.aligreen.ImageLibArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform");
            var defaultUalunB = new BizType("defaultUalunB", BizTypeArgs.builder()
                .bizTypeName(name)
                .build());
    
            var default_ = new ImageLib("default", ImageLibArgs.builder()
                .category("BLACK")
                .enable(true)
                .scene("PORN")
                .imageLibName(name)
                .bizTypes(defaultUalunB.bizTypeName())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform
    resources:
      defaultUalunB:
        type: alicloud:aligreen:BizType
        properties:
          bizTypeName: ${name}
      default:
        type: alicloud:aligreen:ImageLib
        properties:
          category: BLACK
          enable: true
          scene: PORN
          imageLibName: ${name}
          bizTypes:
            - ${defaultUalunB.bizTypeName}
    

    Create ImageLib Resource

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

    Constructor syntax

    new ImageLib(name: string, args: ImageLibArgs, opts?: CustomResourceOptions);
    @overload
    def ImageLib(resource_name: str,
                 args: ImageLibArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def ImageLib(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 category: Optional[str] = None,
                 image_lib_name: Optional[str] = None,
                 scene: Optional[str] = None,
                 biz_types: Optional[Sequence[str]] = None,
                 enable: Optional[bool] = None)
    func NewImageLib(ctx *Context, name string, args ImageLibArgs, opts ...ResourceOption) (*ImageLib, error)
    public ImageLib(string name, ImageLibArgs args, CustomResourceOptions? opts = null)
    public ImageLib(String name, ImageLibArgs args)
    public ImageLib(String name, ImageLibArgs args, CustomResourceOptions options)
    
    type: alicloud:aligreen:ImageLib
    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 ImageLibArgs
    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 ImageLibArgs
    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 ImageLibArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ImageLibArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ImageLibArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

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

    var imageLibResource = new AliCloud.Aligreen.ImageLib("imageLibResource", new()
    {
        Category = "string",
        ImageLibName = "string",
        Scene = "string",
        BizTypes = new[]
        {
            "string",
        },
        Enable = false,
    });
    
    example, err := aligreen.NewImageLib(ctx, "imageLibResource", &aligreen.ImageLibArgs{
    	Category:     pulumi.String("string"),
    	ImageLibName: pulumi.String("string"),
    	Scene:        pulumi.String("string"),
    	BizTypes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Enable: pulumi.Bool(false),
    })
    
    var imageLibResource = new ImageLib("imageLibResource", ImageLibArgs.builder()
        .category("string")
        .imageLibName("string")
        .scene("string")
        .bizTypes("string")
        .enable(false)
        .build());
    
    image_lib_resource = alicloud.aligreen.ImageLib("imageLibResource",
        category="string",
        image_lib_name="string",
        scene="string",
        biz_types=["string"],
        enable=False)
    
    const imageLibResource = new alicloud.aligreen.ImageLib("imageLibResource", {
        category: "string",
        imageLibName: "string",
        scene: "string",
        bizTypes: ["string"],
        enable: false,
    });
    
    type: alicloud:aligreen:ImageLib
    properties:
        bizTypes:
            - string
        category: string
        enable: false
        imageLibName: string
        scene: string
    

    ImageLib Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ImageLib resource accepts the following input properties:

    Category string
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    ImageLibName string
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    Scene string
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    BizTypes List<string>
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    Enable bool
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    Category string
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    ImageLibName string
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    Scene string
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    BizTypes []string
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    Enable bool
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    category String
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    imageLibName String
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    scene String
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    bizTypes List<String>
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    enable Boolean
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    category string
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    imageLibName string
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    scene string
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    bizTypes string[]
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    enable boolean
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    category str
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    image_lib_name str
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    scene str
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    biz_types Sequence[str]
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    enable bool
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    category String
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    imageLibName String
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    scene String
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    bizTypes List<String>
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    enable Boolean
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ImageLib 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 ImageLib Resource

    Get an existing ImageLib 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?: ImageLibState, opts?: CustomResourceOptions): ImageLib
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            biz_types: Optional[Sequence[str]] = None,
            category: Optional[str] = None,
            enable: Optional[bool] = None,
            image_lib_name: Optional[str] = None,
            scene: Optional[str] = None) -> ImageLib
    func GetImageLib(ctx *Context, name string, id IDInput, state *ImageLibState, opts ...ResourceOption) (*ImageLib, error)
    public static ImageLib Get(string name, Input<string> id, ImageLibState? state, CustomResourceOptions? opts = null)
    public static ImageLib get(String name, Output<String> id, ImageLibState 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:
    BizTypes List<string>
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    Category string
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    Enable bool
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    ImageLibName string
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    Scene string
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    BizTypes []string
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    Category string
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    Enable bool
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    ImageLibName string
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    Scene string
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    bizTypes List<String>
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    category String
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    enable Boolean
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    imageLibName String
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    scene String
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    bizTypes string[]
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    category string
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    enable boolean
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    imageLibName string
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    scene string
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    biz_types Sequence[str]
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    category str
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    enable bool
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    image_lib_name str
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    scene str
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection
    bizTypes List<String>
    List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"]
    category String
    The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list
    enable Boolean
    Specifies whether to enable the image library. Valid values: true: Enable the image library. This is the default value. false: Disable the image library.
    imageLibName String
    The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    scene String
    The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection

    Import

    Aligreen Image Lib can be imported using the id, e.g.

    $ pulumi import alicloud:aligreen/imageLib:ImageLib example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi