All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::OOS::GitCodeRepo

更新時間:Oct 08, 2024

DATASOURCE::OOS::GitCodeRepo is used to generate the URL of a user-specified GitHub or Gitee code repository.

Syntax

{
  "Type": "DATASOURCE::OOS::GitCodeRepo",
  "Properties": {
    "Owner": String,
    "Platform": String,
    "Repository": String,
    "CommitId": String,
    "Organization": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Owner

String

Yes

No

The Git account.

None.

Platform

String

Yes

No

The platform.

Valid values:

  • github

  • gitee

Repository

String

Yes

No

The repository name.

None.

CommitId

String

No

Yes

The commit ID.

None.

Organization

String

No

No

The name of the Git organization.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values

Fn::GetAtt

AuthorizedUrl: the URL of the specified GitHub or Gitee code repository.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Repository:
        Type: String
        Description:
          en: Git repository.
        Required: true
      Owner:
        Type: String
        Description:
          en: Git account.
        Required: true
      Platform:
        Type: String
        Description:
          en: Git platform.
        AllowedValues:
          - github
          - gitee
        Required: true
    Resources:
      GitCodeRepo:
        Type: DATASOURCE::OOS::GitCodeRepo
        Properties:
          Repository:
            Ref: Repository
          Owner:
            Ref: Owner
          Platform:
            Ref: Platform
    Outputs:
      AuthorizedUrl:
        Description: Authorized url.
        Value:
          Fn::GetAtt:
            - GitCodeRepo
            - AuthorizedUrl
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Repository": {
          "Type": "String",
          "Description": {
            "en": "Git repository."
          },
          "Required": true
        },
        "Owner": {
          "Type": "String",
          "Description": {
            "en": "Git account."
          },
          "Required": true
        },
        "Platform": {
          "Type": "String",
          "Description": {
            "en": "Git platform."
          },
          "AllowedValues": [
            "github",
            "gitee"
          ],
          "Required": true
        }
      },
      "Resources": {
        "GitCodeRepo": {
          "Type": "DATASOURCE::OOS::GitCodeRepo",
          "Properties": {
            "Repository": {
              "Ref": "Repository"
            },
            "Owner": {
              "Ref": "Owner"
            },
            "Platform": {
              "Ref": "Platform"
            }
          }
        }
      },
      "Outputs": {
        "AuthorizedUrl": {
          "Description": "Authorized url.",
          "Value": {
            "Fn::GetAtt": [
              "GitCodeRepo",
              "AuthorizedUrl"
            ]
          }
        }
      }
    }