API

The DevOps Insights feature is still in development. You can use this API; however, please keep in mind that it could change at anytime.

Insights Reports API

Get a list of Insights reports

GET: /api/{spaceId}/insights/reports Returns a paginated list of the Insights reports in the supplied Octopus Deploy space.

Parameters

NameDescription
spaceIdId of the space
skipNumber of items to skip. Defaults to zero
takeNumber of items to take (i.e. the page size). Defaults to 30

Sample response

{
  "ItemType": "InsightsReport",
  "TotalResults": 2,
  "ItemsPerPage": 30,
  "NumberOfPages": 1,
  "LastPageNumber": 0,
  "Items": [
    {
      "Id": "InsightsReports-1",
      "SpaceId": "Spaces-1",
      "Name": "High Volume Report",
      "Description": "High volume tenanted deployments report",
      "ProjectGroupIds": ["ProjectGroups-1", "ProjectGroups-2"],
      "ProjectIds": ["Projects-1", "Projects-2"],
      "TenantIds": ["Tenants-1", "Tenants-2", "Tenants-3"],
      "TenantTags": [
        "Deployment Group/Group A",
        "Deployment Group/Group B",
        "Deployment Group/Group C",
        "Location/Australia",
        "Location/Asia",
        "Location/Europe",
        "Location/US"
      ],
      "TenantMode": "TenantedAndUntenanted",
      "EnvironmentGroups": [
        {
          "Name": "Test",
          "Environments": ["Environments-1", "Environments-2"]
        },
        {
          "Name": "Internal",
          "Environments": ["Environments-3", "Environments-4"]
        },
        {
          "Name": "Production",
          "Environments": ["Environments-5", "Environments-6"]
        }
      ],
      "TimeZone": "UTC",
      "IconId": "map-signs",
      "IconColor": "#3CA4F3",
      "Links": {
        "Self": "/api/Spaces-1/insights/reports/InsightsReports-1",
        "Logo": "/api/Spaces-1/insights/reports/InsightsReports-1/logo"
      }
    }
  ],
  "Links": {
    "Self": "/api/Spaces-1/insights/reports?skip=0&take=30",
    "Template": "/api/Spaces-1/insights/reports{?skip,take}",
    "Page.All": "/api/Spaces-1/insights/reports?skip=0&take=2147483647",
    "Page.Current": "/api/Spaces-1/insights/reports?skip=0&take=30",
    "Page.Last": "/api/Spaces-1/insights/reports?skip=0&take=30"
  }
}

Properties

PropertyDescription
ItemTypeThe type of resource - for Insights Reports, this will always be “InsightsReport”
TotalResultsThe total number of reports
ItemsPerPageThe number of reports per page
NumberOfPagesThe total number of pages
LastPageNumberThe number of the last page of reports, counting from zero
ItemsAn array of the reports returned for the current page. See the section Get a specific Insights Report for details of the report structure
LinksLinks to other resources. See REST API Links https://octopus.com/docs/octopus-rest-api#api-links

Create an Insights report

POST: /api/{spaceId}/insights/reports Create a new Insights report.

Parameters

NameDescription
spaceIdId of the space

Request Body

The request body is in JSON format.

Sample request

{
    "SpaceId": "Spaces-1",
    "Name": "High Volume Report",
    "Description": "High volume tenanted deployments report",
    "ProjectGroupIds": ["ProjectGroups-1", "ProjectGroups-2"],
    "ProjectIds": ["Projects-1", "Projects-2"],
    "TenantIds": ["Tenants-1", "Tenants-2", "Tenants-3"],
    "TenantTags": [
      "Deployment Group/Group A",
      "Deployment Group/Group B",
      "Deployment Group/Group C",
      "Location/Australia",
      "Location/Asia",
      "Location/Europe",
      "Location/US"
    ],
    "TenantMode": "TenantedAndUntenanted",
    "EnvironmentGroups": [
      {
        "Name": "Test",
        "Environments": ["Environments-1", "Environments-2"]
      },
      {
        "Name": "Internal",
        "Environments": ["Environments-3", "Environments-4"]
      },
      {
        "Name": "Production",
        "Environments": ["Environments-5", "Environments-6"]
      }
    ],
    "TimeZone": "UTC"
}

Properties

PropertyDescription
SpaceIdRequiredThe id of the space to contain the report
NameRequiredThe name of the report
DescriptionOptionalThe description of the report
ProjectGroupIdsOptionalAn array of the project group ids to be included in the report
ProjectIdsOptionalAn array of the project ids to be included in the report
TenantIdsOptionalAn array of the tenant ids to be included in the report
TenantTagsOptionalAn array of the tenant tags to be associated with this report
TenantModeOptionalIndicates what types of deployments will be contributing to this report. May be TenantedAndUntenanted, Tenanted, or Untenanted
EnvironmentGroupsOptionalAn array of the environment groups to be included in this report. See below for details
TimeZoneOptionalThe timezone to be used in the report. Must be either a Windows or IANA (Tzdb) timezone

EnvironmentGroups Properties

PropertyDescription
NameRequiredThe name of the environment group. Must be unique per report
EnvironmentsRequiredAn array of the ids of the environments to include in the group

Get a specific Insights report

GET: /api/{spaceId}/insights/reports/{reportId} Retrieves an existing Insights report.

Parameters

NameDescription
spaceIdId of the space containing the report
reportIdId of the report to retrieve

Sample response

{
  "Id": "InsightsReports-1",
  "SpaceId": "Spaces-1",
  "Name": "High Volume Report",
  "Description": "High volume tenanted deployments report",
  "ProjectGroupIds": ["ProjectGroups-1", "ProjectGroups-2"],
  "ProjectIds": ["Projects-1", "Projects-2"],
  "TenantIds": ["Tenants-1", "Tenants-2", "Tenants-3"],
  "TenantTags": [
    "Deployment Group/Group A",
    "Deployment Group/Group B",
    "Deployment Group/Group C",
    "Location/Australia",
    "Location/Asia",
    "Location/Europe",
    "Location/US"
  ],
  "TenantMode": "TenantedAndUntenanted",
  "EnvironmentGroups": [
    {
      "Name": "Test",
      "Environments": ["Environments-1", "Environments-2"]
    },
    {
      "Name": "Internal",
      "Environments": ["Environments-3", "Environments-4"]
    },
    {
      "Name": "Production",
      "Environments": ["Environments-5", "Environments-6"]
    }
  ],
  "TimeZone": "UTC",
  "IconId": null,
  "IconColor": null,
  "Links": {
    "Self": "/api/Spaces-1/insights/reports/InsightsReports-1",
    "Logo": "/api/Spaces-1/insights/reports/InsightsReports-1/logo"
  }
}

Properties

PropertyDescription
IdThe id of the Insights report
SpaceIdThe id of the space containing the report
NameThe name of the report
DescriptionThe description of the report
ProjectGroupIdsAn array of the project group ids included in the report
ProjectIdsAn array of the project ids included in the report
TenantIdsAn array of the tenant ids included in the report
TenantTagsAn array of the tenant tags associated with this report
TenantModeIndicates what types of deployments contributed to this report. May be TenantedAndUntenanted, Tenanted, or Untenanted
EnvironmentGroupsAn array of the environment groups included in this report
TimeZoneThe timezone used in the report, in Windows timezone format
IconIdA Font Awesome icon name
IconColorThe icon color in hex format (example: ‘#0D80D8’)
LinksLinks to other resources. See REST API Links

Update an Insights report

PUT: /api/{spaceId}/insights/reports/{reportId} Updates an existing Insights report.

Parameters

NameDescription
spaceIdId of the space containing the report
reportIdThe id of the Insights report to update

Request Body

The request body is in JSON format.

Sample request

{
    "SpaceId": "Spaces-1",
    "Id": "InsightsReports-1",
    "Name": "High Volume Report",
    "Description": "High volume tenanted deployments report",
    "ProjectGroupIds": ["ProjectGroups-1", "ProjectGroups-2"],
    "ProjectIds": ["Projects-1", "Projects-2"],
    "TenantIds": ["Tenants-1", "Tenants-2", "Tenants-3"],
    "TenantTags": [
      "Deployment Group/Group A",
      "Deployment Group/Group B",
      "Deployment Group/Group C",
      "Location/Australia",
      "Location/Asia",
      "Location/Europe",
      "Location/US"
    ],
    "TenantMode": "TenantedAndUntenanted",
    "EnvironmentGroups": [
      {
        "Name": "Test",
        "Environments": ["Environments-1", "Environments-2"]
      },
      {
        "Name": "Internal",
        "Environments": ["Environments-3", "Environments-4"]
      },
      {
        "Name": "Production",
        "Environments": ["Environments-5", "Environments-6"]
      }
    ],
    "TimeZone": "UTC"
}

Properties

PropertyRequiredDescription
SpaceIdRequiredThe id of the space containing the report.
IdRequiredThe id of the report to be updated.
NameRequiredThe name of the report.
DescriptionOptionalThe description of the report.
ProjectGroupIdsOptionalAn array of the project group ids to be included in the report.
ProjectIdsOptionalAn array of the project ids to be included in the report.
TenantIdsOptionalAn array of the tenant ids to be included in the report.
TenantTagsOptionalAn array of the tenant tags to be associated with this report.
TenantModeOptionalIndicates what types of deployments will be contributing to this report. May be TenantedAndUntenanted, Tenanted, or Untenanted.
EnvironmentGroupsOptionalAn array of the environment groups to be included in this report.
TimeZoneOptionalThe timezone to be used in the report. Must be either a Windows or IANA (Tzdb) timezone.

Delete an insights report

DELETE: /api/{spaceId}/insights/reports/{reportId} Deletes an existing Insights report.

Parameters

NameDescription
spaceIdId of the space containing the report
reportIdThe id of the Insights report to delete

Get deployment level insights metrics

GET: /api/{spaceId}/insights/reports/{reportId}/deployments Returns the streams of deployments for the given report. A stream is a sequence of deployments used to calculate metrics. Includes all the deployments with their Insights metrics for the last 12 whole months and this month, for the specified report.

Parameters

NameDescription
spaceIdId of the space containing the report
reportIdThe id of the Insights report for which to retrieve details

Sample response

{
  "ReportName": "High Volume Report",
  "Streams": [
    {
      "ProjectId": "Projects-1",
      "ProjectName": "My Project 1",
      "ChannelId": "Channels-1",
      "ChannelName": "My Channel 1",
      "EnvironmentId": "Environments-1",
      "EnvironmentName": "Test Environment",
      "TenantId": "Tenants-1",
      "TenantName": "Australia East",
      "Deployments": [
        {
          "Id": "Deployments-1",
          "ReleaseVersion": "2022.3.1",
          "TaskState": "Success",
          "CompletedTime": "2022-08-18T14:28:15.9395818Z",
          "HadGuidedFailure": false,
          "LeadTime": "1:12:39.41517",
          "LeadTimeCalculatedFromVersion": "2022.3.0",
          "TimeSincePreviouslySuccessfulDeployment": null,
          "PreviousSuccessfulDeploymentId": null,
          "TimeToRecovery": null,
          "DeploymentsUntilRecovery": null,
          "RecoveredFromFailedDeploymentId": null,
          "RecoveredFromFailedReleaseVersion": null
        },
        {
          "Id": "Deployments-2",
          "ReleaseVersion": "2022.3.1",
          "TaskState": "Success",
          "CompletedTime": "2022-08-18T15:28:15.9395818Z",
          "HadGuidedFailure": false,
          "LeadTime": "0:01:00.0",
          "LeadTimeCalculatedFromVersion": "2022.3.1",
          "TimeSincePreviouslySuccessfulDeployment": "0:01:00.0",
          "PreviousSuccessfulDeploymentId": "Deployments-1",
          "TimeToRecovery": null,
          "DeploymentsUntilRecovery": null,
          "RecoveredFromFailedDeploymentId": null,
          "RecoveredFromFailedReleaseVersion": null
        }
      ]
    }
  ]
}

Properties

PropertyDescription
ReportNameThe name of the report
StreamsAn array of streams. A stream is a sequence of deployments used to calculate metrics

Streams properties

PropertyDescription
ProjectIdThe id of the project for this stream.
ProjectNameThe name of the project for this stream. Will be null if you don’t have access to this project.
ChannelIdThe id of the channel for this stream.
ChannelNameThe name of the channel for this stream. Will be null if you don’t have access to this channel.
EnvironmentIdThe id of the environment for this stream.
EnvironmentNameThe name of the environment for this stream. Will be null if you don’t have access to this environment.
TenantIdThe id of the tenant for this stream.
TenantNameThe name of the tenant for this stream. Will be null if you don’t have access to this tenant.
DeploymentsAn array of the deployments in this stream.

Deployments properties

PropertyDescription
IdThe id of the deployment.
ReleaseVersionThe version of the release that was deployed.
TaskStateIndicates the state of the deployment task.
CompletedTimeWhen the deployment completed.
HadGuidedFailureWhether or not the deployment had a guided failure.
LeadTimeThe lead time of the deployment.
LeadTimeCalculatedFromVersionThe version of the release containing the earliest change included in the deployment.
TimeSincePreviouslySuccessfulDeploymentThe time period since the previous successful deployment.
PreviousSuccessfulDeploymentIdThe id of the previous successful deployment.
TimeToRecoveryThe period of time taken to recover from one or more failed deployments, until this deployment (if successful).
DeploymentsUntilRecoveryNumber of attempted deployments until this deployment occurred (if successful).
RecoveredFromFailedDeploymentIdThe id of the first failed deployment in a series of one or more failed deployments.
RecoveredFromFailedReleaseVersionThe first version which had a failed deployment in a series of one or more failed deployments.

Get deployment level aggregated insights metrics

GET: /api/{spaceId}/insights/reports/{reportId}/metrics

Parameters

NameDescription
spaceIdId of the space containing the report.
reportIdThe id of the Insights report to retrieve details for.
splitHow to split the metrics. Should be ‘None’, ‘Project’, ‘ProjectGroup’, ‘Environment’, ‘EnvironmentGroup’, ‘Tenant’, ‘TenantTagSet’.
tenantTagSetIdIf TenantTagSet is chosen for Split, this is required, otherwise it is ignored. It is the tag set to split on.
timeRangeThe time period to get data for. Should be ‘LastMonth’, ‘LastQuarter’, or ‘LastYear’
granularityThe data grouping granularity, defaults to weekly if not supplied. Should be ‘Monthly’, ‘Weekly’, or ‘Daily’.

Sample response

{
  "Series": [
    {
      "Name": "All",
      "Intervals": [
        {
          "StartOfInterval": "2022-06-05",
          "NumberOfSuccessfulDeployments": 247,
          "LeadTime": {
            "Count": 243,
            "Mean": "-2:32:31.0",
            "Median": "3:17:51.0",
            "Min": "-426:53:44.0",
            "Max": "93:32:33.0",
            "NinetyFifth": "28:15:32.0"
          },
          "DeploymentFailureRate": {
            "Successful": 247,
            "DeploymentFailure": 8,
            "SuccessfulButHadGuidedFailure": 0,
            "Total": 255,
            "Failed": 8,
            "Rate": 0.03137
          },
          "TimeSincePreviousDeployment": {
            "Count": 241,
            "Mean": "2:12:32.0",
            "Median": "1:21:56.0",
            "Min": "0:10:00.0",
            "Max": "12:40:01.0",
            "NinetyFifth": "7:29:43.0"
          },
          "MeanTimeToRecovery": {
            "Count": 8,
            "Mean": "5:26:50.0",
            "Median": "2:17:17.0",
            "Min": "0:41:12.0",
            "Max": "17:11:09.0",
            "NinetyFifth": "14:55:01.0"
          },
          "DeploymentsUntilRecovery": {
            "Count": 8,
            "Mean": 1.0,
            "Median": 1.0,
            "Min": 1.0,
            "Max": 1.0,
            "NinetyFifth": 1.0
          }
        }
      ]
    }
  ]
}

Properties

PropertyDescription
SeriesAn array of the series returned, each containing the values for the split provided

Series Properties

PropertyDescription
NameThe name of the series. If no split is provided, this will be ‘All’
IntervalsAn array of the time periods containing the data returned

LeadTime, TimeSincePreviousDeployment, MeanTimeToRecovery and DeploymentsUntilRecovery Properties

PropertyDescription
CountThe number of deployments aggregated in the current metric for the interval
MeanThe mean value for the current metric for the interval
MedianThe median value for the current metric for the interval
MinThe minimum value for the current metric for the interval
MaxThe maximum value for the current metric for the interval
NinetyFifthThe 95th percentile value for the current metric for the interval

DeploymentFailureRate Properties

PropertyDescription
SuccessfulThe number of successful deployments for the interval
DeploymentFailureThe number of deployments with failures
SuccessfulButHadGuidedFailureThe number of deployments which succeeded, but only with guided failures
TotalThe total number of deployments for the interval
FailedThe number of failed deployments for the interval
RateThe percentage of failed deployments to successful deployments for the interval

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Page updated on Wednesday, October 4, 2023