All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::Aligreen::ImageLib

Last Updated:Apr 29, 2025

ALIYUN::Aligreen::ImageLib is used to create a custom image library.

Syntax

{
  "Type": "ALIYUN::Aligreen::ImageLib",
  "Properties": {
    "Category": String,
    "ImageLibName": String,
    "Scene": String,
    "BizTypes": List,
    "Enable": Boolean
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Category

String

Yes

No

The category of the image library.

Valid values:

  • BLACK: blacklist.

  • WHITE: whitelist.

  • REVIEW: review list.

ImageLibName

String

Yes

Yes

The name of the image library.

None.

Scene

String

Yes

No

The moderation scenario to which the image library applies.

Valid values:

  • PORN: pornography detection.

  • AD: advertisement detection.

  • ILLEGAL: terrorist content detection.

BizTypes

List

No

Yes

The business scenarios.

For more information, see CreateBizType. You can specify up to three business scenarios.

Enable

Boolean

No

Yes

Specifies whether to enable the image library.

Valid values:

  • true (default)

  • false

Return values

Fn::GetAtt

  • Category: the category of the image library.

  • BizTypes: the business scenarios.

  • ImageLibId: the ID of the image library.

  • Enable: indicates whether the image library is enabled.

  • Scene: the moderation scenario to which the image library applies.

  • ImageLibName: the name of the image library.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Category:
    Type: String
    Description:
      en: 'The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list.'
    AllowedValues:
      - BLACK
      - WHITE
      - REVIEW
    Required: true
  BizTypes:
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Description:
          en: The type of the Biz.
        AllowedValues:
          - bizTypeA
          - bizTypeB
          - bizTypeC
        Required: false
    AssociationProperty: List[Parameter]
    Type: Json
    Description:
      en: 'List of business scenarios. For example: ["bizTypeA", "bizTypeB", "bizTypeC"].'
    Required: false
    MinLength: 1
    MaxLength: 3
  Scene:
    Type: String
    Description:
      en: 'The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection.'
    AllowedValues:
      - PORN
      - AD
      - ILLEGAL
    Required: true
  ImageLibName:
    Type: String
    Description:
      en: The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_).
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::Aligreen::ImageLib
    Properties:
      Category:
        Ref: Category
      BizTypes:
        Ref: BizTypes
      Scene:
        Ref: Scene
      ImageLibName:
        Ref: ImageLibName
Outputs:
  Category:
    Description: The category of the image library.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Category
  BizTypes:
    Description: List of business scenarios.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - BizTypes
  ImageLibId:
    Description: The ID of the primary key of the image library.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ImageLibId
  Enable:
    Description: Specifies whether to enable the image library.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Enable
  Scene:
    Description: The moderation scenario to which the custom image library applies.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Scene
  ImageLibName:
    Description: The name of the image library defined by the customer.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ImageLibName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Category": {
      "Type": "String",
      "Description": {
        "en": "The category of the image library. Valid values: BLACK: a blacklist, WHITE: a whitelist, REVIEW: a review list."
      },
      "AllowedValues": [
        "BLACK",
        "WHITE",
        "REVIEW"
      ],
      "Required": true
    },
    "BizTypes": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Description": {
            "en": "The type of the Biz."
          },
          "AllowedValues": [
            "bizTypeA",
            "bizTypeB",
            "bizTypeC"
          ],
          "Required": false
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "List of business scenarios. For example: [\"bizTypeA\", \"bizTypeB\", \"bizTypeC\"]."
      },
      "Required": false,
      "MinLength": 1,
      "MaxLength": 3
    },
    "Scene": {
      "Type": "String",
      "Description": {
        "en": "The moderation scenario to which the custom image library applies. Valid values: PORN: pornography detection, AD: ad detection, ILLEGAL: terrorist content detection."
      },
      "AllowedValues": [
        "PORN",
        "AD",
        "ILLEGAL"
      ],
      "Required": true
    },
    "ImageLibName": {
      "Type": "String",
      "Description": {
        "en": "The name of the image library defined by the customer. It can contain no more than 20 characters in Chinese, English, and underscore (_)."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::Aligreen::ImageLib",
      "Properties": {
        "Category": {
          "Ref": "Category"
        },
        "BizTypes": {
          "Ref": "BizTypes"
        },
        "Scene": {
          "Ref": "Scene"
        },
        "ImageLibName": {
          "Ref": "ImageLibName"
        }
      }
    }
  },
  "Outputs": {
    "Category": {
      "Description": "The category of the image library.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Category"
        ]
      }
    },
    "BizTypes": {
      "Description": "List of business scenarios.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "BizTypes"
        ]
      }
    },
    "ImageLibId": {
      "Description": "The ID of the primary key of the image library.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ImageLibId"
        ]
      }
    },
    "Enable": {
      "Description": "Specifies whether to enable the image library.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Enable"
        ]
      }
    },
    "Scene": {
      "Description": "The moderation scenario to which the custom image library applies.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Scene"
        ]
      }
    },
    "ImageLibName": {
      "Description": "The name of the image library defined by the customer.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ImageLibName"
        ]
      }
    }
  }
}