swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: AutomationManagement
  version: 2017-05-15-preview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/automation/resource-manager/Microsoft.Automation/preview/2017-05-15-preview/sourceControlSyncJob.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: automation-sourceControlSyncJob
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs":
    get:
      description: Retrieve a list of source control sync jobs.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations
      operationId: SourceControlSyncJob_ListByAutomationAccount
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The source control name.
          in: path
          name: sourceControlName
          required: true
          type: string
        - description: The filter to apply on the operation.
          in: query
          name: $filter
          required: false
          type: string
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/SourceControlSyncJobListResult"
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - SourceControlSyncJob
      x-ms-examples:
        Get a list of source control sync jobs:
          parameters:
            api-version: 2017-05-15-preview
            automationAccountName: myAutomationAccount33
            resourceGroupName: rg
            sourceControlName: MySourceControl
            subscriptionId: subid
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/sourceControls/MySourceControl/sourceControlSyncJobs/ce6fe3e3-9db3-4096-a6b4-82bfb4c10a1a
                    properties:
                      creationTime: 2017-03-28T23:14:26.903+00:00
                      endTime: 2017-03-28T23:14:28.903+00:00
                      provisioningState: Completed
                      sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a1a
                      startTime: 2017-03-28T23:14:27.903+00:00
                      syncType: PartialSync
                  - id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/sourceControls/MySourceControl/sourceControlSyncJobs/ce6fe3e3-9db3-4096-a6b4-82bfb4c10a2a
                    properties:
                      creationTime: 2017-03-28T23:14:26.903+00:00
                      endTime: 2017-03-28T23:14:28.903+00:00
                      provisioningState: Completed
                      sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a2a
                      startTime: 2017-03-28T23:14:27.903+00:00
                      syncType: PartialSync
                  - id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/sourceControls/MySourceControl/sourceControlSyncJobs/ce6fe3e3-9db3-4096-a6b4-82bfb4c10a3a
                    properties:
                      creationTime: 2017-03-28T23:14:26.903+00:00
                      endTime: 2017-03-28T23:14:28.903+00:00
                      provisioningState: Completed
                      sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a3a
                      startTime: 2017-03-28T23:14:27.903+00:00
                      syncType: PartialSync
                  - id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/sourceControls/MySourceControl/sourceControlSyncJobs/ce6fe3e3-9db3-4096-a6b4-82bfb4c10a4a
                    properties:
                      creationTime: 2017-03-28T23:14:26.903+00:00
                      endTime: 2017-03-28T23:14:28.903+00:00
                      provisioningState: Completed
                      sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a4a
                      startTime: 2017-03-28T23:14:27.903+00:00
                      syncType: PartialSync
                  - id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/sourceControls/MySourceControl/sourceControlSyncJobs/ce6fe3e3-9db3-4096-a6b4-82bfb4c10a5a
                    properties:
                      creationTime: 2017-03-28T23:14:26.903+00:00
                      endTime: 2017-03-28T23:14:28.903+00:00
                      provisioningState: Completed
                      sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a5a
                      startTime: 2017-03-28T23:14:27.903+00:00
                      syncType: PartialSync
              headers: {}
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}":
    get:
      description: Retrieve the source control sync job identified by job id.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations
      operationId: SourceControlSyncJob_Get
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The source control name.
          in: path
          name: sourceControlName
          required: true
          type: string
        - description: The source control sync job id.
          format: uuid
          in: path
          name: sourceControlSyncJobId
          required: true
          type: string
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/SourceControlSyncJobById"
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - SourceControlSyncJob
      x-ms-examples:
        Get a source control sync job by job id:
          parameters:
            api-version: 2017-05-15-preview
            automationAccountName: myAutomationAccount33
            resourceGroupName: rg
            sourceControlName: MySourceControl
            sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/sourceControls/MySourceControl/sourceControlSyncJobs/ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a
                properties:
                  creationTime: 2017-03-28T23:14:26.903+00:00
                  endTime: 2017-03-28T23:14:28.903+00:00
                  exception: ""
                  provisioningState: Completed
                  sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a
                  startTime: 2017-03-28T23:14:27.903+00:00
                  syncType: PartialSync
              headers: {}
    put:
      description: Creates the sync job for a source control.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations
      operationId: SourceControlSyncJob_Create
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The source control name.
          in: path
          name: sourceControlName
          required: true
          type: string
        - description: The source control sync job id.
          format: uuid
          in: path
          name: sourceControlSyncJobId
          required: true
          type: string
        - description: The parameters supplied to the create source control sync job operation.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/SourceControlSyncJobCreateParameters"
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "201":
          description: Created
          schema:
            $ref: "#/definitions/SourceControlSyncJob"
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - SourceControlSyncJob
      x-ms-examples:
        Create or update a source control sync job:
          parameters:
            api-version: 2017-05-15-preview
            automationAccountName: myAutomationAccount33
            parameters:
              properties:
                commitId: 9de0980bfb45026a3d97a1b0522d98a9f604226e
            resourceGroupName: rg
            sourceControlName: MySourceControl
            sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a
            subscriptionId: subid
          responses:
            "201":
              body:
                id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/sourceControls/MySourceControl/sourceControlSyncJobs/ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a
                properties:
                  creationTime: 2017-03-28T23:14:26.903+00:00
                  endTime: 2017-03-28T23:14:28.903+00:00
                  provisioningState: Completed
                  sourceControlSyncJobId: ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a
                  startTime: 2017-03-28T23:14:27.903+00:00
                  syncType: PartialSync
              headers: {}
definitions:
  SourceControlSyncJob:
    description: Definition of the source control sync job.
    properties:
      id:
        description: Resource id.
        readOnly: true
        type: string
      name:
        description: Resource name.
        readOnly: true
        type: string
      properties:
        $ref: "#/definitions/SourceControlSyncJobProperties"
        description: The properties of the source control sync job.
        x-ms-client-flatten: true
      type:
        description: Resource type.
        readOnly: true
        type: string
  SourceControlSyncJobById:
    description: Definition of the source control sync job.
    properties:
      id:
        description: The id of the job.
        type: string
      properties:
        $ref: "#/definitions/SourceControlSyncJobByIdProperties"
        description: The properties of the source control sync job.
        x-ms-client-flatten: true
  SourceControlSyncJobByIdProperties:
    description: Definition of source control sync job properties.
    properties:
      creationTime:
        description: The creation time of the job.
        format: date-time
        readOnly: true
        type: string
        x-nullable: false
      endTime:
        description: The end time of the job.
        format: date-time
        readOnly: true
        type: string
        x-nullable: true
      exception:
        description: The exceptions that occurred while running the sync job.
        type: string
      provisioningState:
        description: The provisioning state of the job.
        enum:
          - Completed
          - Failed
          - Running
        type: string
        x-ms-enum:
          modelAsString: true
          name: provisioningState
      sourceControlSyncJobId:
        description: The source control sync job id.
        type: string
      startTime:
        description: The start time of the job.
        format: date-time
        readOnly: true
        type: string
        x-nullable: true
      syncType:
        description: The sync type.
        enum:
          - PartialSync
          - FullSync
        type: string
        x-ms-enum:
          modelAsString: true
          name: syncType
  SourceControlSyncJobCreateParameters:
    description: The parameters supplied to the create source control sync job operation.
    properties:
      properties:
        $ref: "#/definitions/SourceControlSyncJobCreateProperties"
        description: The properties of the source control sync job.
        x-ms-client-flatten: true
    required:
      - properties
  SourceControlSyncJobCreateProperties:
    description: Definition of create source control sync job properties.
    properties:
      commitId:
        description: The commit id of the source control sync job. If not syncing to a commitId, enter an empty string.
        minLength: 0
        type: string
    required:
      - commitId
  SourceControlSyncJobListResult:
    description: The response model for the list source control sync jobs operation.
    properties:
      nextLink:
        description: The next link.
        type: string
      value:
        description: The list of source control sync jobs.
        items:
          $ref: "#/definitions/SourceControlSyncJob"
        type: array
  SourceControlSyncJobProperties:
    description: Definition of source control sync job properties.
    properties:
      creationTime:
        description: The creation time of the job.
        format: date-time
        readOnly: true
        type: string
        x-nullable: false
      endTime:
        description: The end time of the job.
        format: date-time
        readOnly: true
        type: string
        x-nullable: true
      provisioningState:
        description: The provisioning state of the job.
        enum:
          - Completed
          - Failed
          - Running
        type: string
        x-ms-enum:
          modelAsString: true
          name: provisioningState
      sourceControlSyncJobId:
        description: The source control sync job id.
        type: string
      startTime:
        description: The start time of the job.
        format: date-time
        readOnly: true
        type: string
        x-nullable: true
      syncType:
        description: The sync type.
        enum:
          - PartialSync
          - FullSync
        type: string
        x-ms-enum:
          modelAsString: true
          name: syncType
