Ejemplo n.º 1
0
    public void TestMostEverything()
    {
        var signal = new IrmCreateIncident().CreateIncidentWithSignal(s_projectId);

        try
        {
            string incidentId = IncidentName.Parse(signal.Incident).IncidentId;
            var    annotation = new IrmAnnotateIncident().AnnotateIncident(s_projectId, incidentId);
            new IrmChangeSeverity().ChangeSeverity(s_projectId, incidentId);
            new IrmChangeStage().ChangeStageAtomically(s_projectId, incidentId);
        }
        finally
        {
            // I see now way to clean up old incidents!
        }
    }
    public string AnnotateIncident(
        string projectId  = "YOUR-PROJECT-ID",
        string incidentId = "an.opaque.random.id")
    {
        // Create client
        IncidentServiceClient incidentServiceClient =
            IncidentServiceClient.Create();

        // Describe the annotation.
        Annotation newAnnotation = new Annotation()
        {
            Content = "The red button was found in a depressed state."
        };
        string parent = new IncidentName(projectId, incidentId).ToString();

        // Call the API to create the annotation.
        Annotation annotation =
            incidentServiceClient.CreateAnnotation(parent, newAnnotation);

        Console.WriteLine("Created annotation {0}.", annotation.Name);
        return(annotation.Name);
    }