ALIYUN::Aligreen::ImageLib

ALIYUN::Aligreen::ImageLib类型用于创建一个图库。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

Category

String

图库类型。

取值:

  • BLACK:风险名单

  • WHITE:可信名单

  • REVIEW:疑似名单

ImageLibName

String

图库名称。

Scene

String

图库使用场景。

取值:

  • PORN:智能鉴黄

  • AD:广告识别

  • ILLEGAL:暴恐涉政识别

BizTypes

List

业务场景列表。

业务场景。更多信息,请参见创建业务场景。最多支持配置3组场景。

Enable

Boolean

是否启用图库。

取值:

  • true(默认):启用

  • false:停用

返回值

Fn::GetAtt

  • Category:图库类型。

  • BizTypes:业务场景列表。

  • ImageLibId:图库ID。

  • Enable:是否启用图库。

  • Scene:图库使用场景。

  • 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
{
  "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"
        ]
      }
    }
  }
}