CoreService

<back to all web services

DisableAlertingResource

Resources - Operations

Disable alerting in the external monitoring system

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
POST/api/resources/{Id}/disablealertingDisable alerting in the external monitoring system
POST/resources/{Id}/disablealertingDisable alerting in the external monitoring system
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports CoreService.ServiceModel.Dtos.Resources.Common.Operations
Imports CoreService.ServiceModel.Dtos.Jobs.Responses
Imports YCO.Dune.Models.Enums
Imports CoreService.ServiceModel.Enums

Namespace Global

    Namespace CoreService.ServiceModel.Dtos.Jobs.Responses

        Public Partial Class JobDto
            Implements IHasIdName
            Implements IHasTenantId
            Implements IAuditable
            Implements IHasObjectType
            '''<Summary>
            '''The id of the job
            '''</Summary>
            Public Overridable Property Id As Guid
            '''<Summary>
            '''The id of the tenant
            '''</Summary>
            Public Overridable Property TenantId As Guid Implements IHasTenantId.TenantId
            '''<Summary>
            '''The name of the job
            '''</Summary>
            Public Overridable Property Name As String Implements IHasIdName.Name
            Public Overridable Property ObjectType As ObjectTypes Implements IHasObjectType.ObjectType
            '''<Summary>
            '''An additional message
            '''</Summary>
            Public Overridable Property Message As String
            '''<Summary>
            '''Api link pointing to this object
            '''</Summary>
            Public Overridable Property SelfLink As String
            '''<Summary>
            '''The id of the configitem the job belongs to
            '''</Summary>
            Public Overridable Property ConfigItemId As Guid?
            '''<Summary>
            '''The type of the configitem the job belongs to
            '''</Summary>
            Public Overridable Property ConfigItemType As ObjectTypes?
            '''<Summary>
            '''The job type
            '''</Summary>
            Public Overridable Property JobType As JobTypes
            '''<Summary>
            '''The current state of the job
            '''</Summary>
            Public Overridable Property State As JobStates
            '''<Summary>
            '''The timestamp, when the job got started
            '''</Summary>
            Public Overridable Property StartTime As Date
            '''<Summary>
            '''The timestamp, when the job has finished
            '''</Summary>
            Public Overridable Property EndTime As Date?
            '''<Summary>
            '''The duration (in seconds) of the job
            '''</Summary>
            Public Overridable Property Duration As Integer
            '''<Summary>
            '''The id of the related workflow
            '''</Summary>
            Public Overridable Property WorkflowId As String
            '''<Summary>
            '''The id of the related scheduled task
            '''</Summary>
            Public Overridable Property SchedulerId As String
            '''<Summary>
            '''The jobs progress in percent (0...100)
            '''</Summary>
            Public Overridable Property Progress As Double
            '''<Summary>
            '''Contains various infos about the job
            '''</Summary>
            Public Overridable Property Config As Dictionary(Of String, Object) = New Dictionary(Of String, Object)
            '''<Summary>
            '''The time the job was created
            '''</Summary>
            Public Overridable Property Created As Date Implements IAuditable.Created
            '''<Summary>
            '''The user the job was created with
            '''</Summary>
            Public Overridable Property CreateUser As String Implements IAuditable.CreateUser
            '''<Summary>
            '''The user id the job was created with
            '''</Summary>
            Public Overridable Property CreateUserId As String Implements IAuditable.CreateUserId
            '''<Summary>
            '''The user email the job was created with
            '''</Summary>
            Public Overridable Property CreateUserEmail As String
            '''<Summary>
            '''The time the job was last modified
            '''</Summary>
            Public Overridable Property Modified As Date Implements IAuditable.Modified
            '''<Summary>
            '''The user the job was modified with
            '''</Summary>
            Public Overridable Property ModifyUser As String Implements IAuditable.ModifyUser
            '''<Summary>
            '''The user id the job was modified with
            '''</Summary>
            Public Overridable Property ModifyUserId As String Implements IAuditable.ModifyUserId
            '''<Summary>
            '''True if the job is deleted
            '''</Summary>
            Public Overridable Property IsDeleted As Boolean Implements IAuditable.IsDeleted
            '''<Summary>
            '''The time the job was deleted
            '''</Summary>
            Public Overridable Property Deleted As Date? Implements IAuditable.Deleted
            '''<Summary>
            '''The user the job was deleted with
            '''</Summary>
            Public Overridable Property DeleteUser As String Implements IAuditable.DeleteUser
            '''<Summary>
            '''The user id the job was deleted with
            '''</Summary>
            Public Overridable Property DeleteUserId As String Implements IAuditable.DeleteUserId
            '''<Summary>
            '''Will be evaluated by event endpoints
            '''</Summary>
            Public Overridable Property SendNotifications As Boolean
            '''<Summary>
            '''True if it is in any of the 'running' states
            '''</Summary>
            Public Overridable Property IsRunning As Boolean
            '''<Summary>
            '''Jobs with failed JobEvents are marked with NeedsAttention
            '''</Summary>
            Public Overridable Property NeedsAttention As Boolean
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Dtos.Resources.Common.Operations

        '''<Summary>
        '''Disable alerting in the external monitoring system
        '''</Summary>
        <Api(Description:="Disable alerting in the external monitoring system")>
        <ApiResponse(Description:="Operation started", IsDefaultResponse:=true, ResponseType:=GetType(JobDto), StatusCode:=202)>
        Public Partial Class DisableAlertingResource
            Implements IActionRequest
            Implements IHasId
            Implements IHasTenantName
            Implements IPost
            '''<Summary>
            '''The primary key of every config item
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The primary key of every config item", Format:="guid", IsRequired:=true, ParameterType:="path")>
            Public Overridable Property Id As Guid Implements IHasId.Id

            <ApiMember(DataType:="string", IsRequired:=true, ParameterType:="header")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property TenantName As String Implements IHasTenantName.TenantName

            '''<Summary>
            '''The duration in which alerting is disabled in minutes
            '''</Summary>
            <ApiMember(DataType:="integer", Description:="The duration in which alerting is disabled in minutes", Format:="int", IsRequired:=true, ParameterType:="body")>
            <Validate(Validator:="GreaterThanOrEqual(10)")>
            <Validate(Validator:="LessThanOrEqual(518400)")>
            Public Overridable Property DurationMinutes As Integer

            '''<Summary>
            '''The reason why alerting is getting disabled
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The reason why alerting is getting disabled", IsRequired:=true, ParameterType:="body")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property Reason As String

            '''<Summary>
            '''Inform users when the job has finished
            '''</Summary>
            <ApiMember(DataType:="bool", Description:="Inform users when the job has finished", ParameterType:="body")>
            Public Overridable Property SendNotifications As Boolean? Implements IActionRequest.SendNotifications
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Enums

        Public Enum JobStates
            Pending
            Starting
            Running
            Suspended
            Stopping
            Completed
            Failed
        End Enum

        Public Enum JobTypes
            Create
            Update
            Delete
            Start
            [Stop]
            Restart
            Backup
            Restore
            Patch
            Action
        End Enum
    End Namespace

    Namespace YCO.Dune.Models.Enums

        Public Enum ObjectTypes
            None
            ConfigItem
            Tenant
            Collection
            Resource
            ComputeNode
            VirtualMachine
            PhysicalMachine
            Disk
            Subnet
            IPAddress
            Job
            JobEvent
            FreezePeriod
            ResourceGroup
            Deployment
            ResourceGroupTemplate
            DeploymentTemplate
            ResourceProvider
            GenericResource
            Role
            Permission
            User
            PatchingWindow
            Update
            ReportDefinition
            TimeSeries
            DataPoint
            Action
            ActionAssignment
            UserNote
        End Enum
    End Namespace
End Namespace

VB.NET DisableAlertingResource DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/resources/{Id}/disablealerting HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id":"00000000-0000-0000-0000-000000000000","tenantName":"String","durationMinutes":0,"reason":"String","sendNotifications":false,"txId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"00000000-0000-0000-0000-000000000000","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"Job","message":"String","selfLink":"String","configItemId":"00000000-0000-0000-0000-000000000000","configItemType":"None","jobType":"Create","state":"Pending","startTime":"0001-01-01T00:00:00.0000000Z","endTime":"0001-01-01T00:00:00.0000000Z","duration":0,"workflowId":"String","schedulerId":"String","progress":0,"config":{"String":{}},"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","createUserEmail":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String","sendNotifications":false,"isRunning":false,"needsAttention":false}