Account Services [Beta]

This contains APIs for account-scoped services.

Retrieve a service

Retrieves the specified service

Securityx-api-key
Request
path Parameters
service
required
string

Identifier field of the service the resource is scoped to

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
200

Example response

get/v1/services/{service}
Request samples
Response samples
{
  • "service": {
    },
  • "created": 1234567890,
  • "updated": 1234567890
}

Update service

Updates the specified service

Securityx-api-key
Request
path Parameters
service
required
string

Identifier field of the service the resource is scoped to

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Request Body schema:
required

Update Service request body

identifier
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

Identifier of the Service

name
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z-_ ]{0,127}$

Name of the Service

description
string <= 1024 characters

Description of the entity

object <= 128 properties

Service tags

yaml
string

YAML for the Service Request

harness_version
string

version of harness yaml

Responses
200

Example response

put/v1/services/{service}
Request samples
{
  • "identifier": "example_service",
  • "name": "Example_service",
  • "description": "This is a example service",
  • "tags": {
    },
  • "yaml": "service:\n name: \"Example_service\"\n identifier: \"example_service\"\n tags: {}\n"
}
Response samples
{
  • "service": {
    },
  • "created": 1234567890,
  • "updated": 1234567890
}

Delete a service

Deletes the requested service

Securityx-api-key
Request
path Parameters
service
required
string

Identifier field of the service the resource is scoped to

query Parameters
forceDelete
boolean
Default: false

Enable this field to force delete the entity

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
200

Example response

delete/v1/services/{service}
Request samples
Response samples
{
  • "service": {
    },
  • "created": 1234567890,
  • "updated": 1234567890
}

List services

Returns a list of the services for which you have view permissions in the given project.

Securityx-api-key
Request
query Parameters
page
integer
Default: 0

Pagination page number strategy: Specify the page number within the paginated collection related to the number of items in each page

limit
integer <= 1000
Default: 20

Number of items to return per page.

search_term
string

This would be used to filter resources having attributes matching with search term.

service_ids
Array of strings unique

List of Service Identifiers

sort
string

Parameter on the basis of which sorting is done.

Enum: "name" "identifier" "created" "updated"
is_access_list
boolean

Specifies whether the list is an access list. An access list is a list of services that you are permitted to use in a pipeline.

deployment_type
string

Service Definition Type

Enum: "Kubernetes" "NativeHelm" "Ssh" "WinRm" "ServerlessAwsLambda" "AzureWebApp" "GitOps" "ECS" "TAS" "CustomDeployment" "Elastigroup" "Asg" "GoogleCloudFunctions" "AwsLambda" "AWS_SAM"
git_ops_enabled
boolean

Enables you to use the service in Harness GitOps PR pipelines.

order
string

Order on the basis of which sorting is done.

Enum: "ASC" "DESC"
header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
200

Example response

get/v1/services
Request samples
Response samples
[
  • {
    }
]

Create a service

Creates a service

Securityx-api-key
Request
header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Request Body schema:
required

Create Service request body

identifier
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z_$]{0,127}$

Identifier of the Service

name
required
string [ 1 .. 128 ] characters ^[a-zA-Z_][0-9a-zA-Z-_ ]{0,127}$

Name of the Service

description
string <= 1024 characters

Description of the entity

object <= 128 properties

Service tags

yaml
string

YAML for the Service Request

harness_version
string

version of harness yaml

Responses
201

Example response

post/v1/services
Request samples
{
  • "identifier": "example_service",
  • "name": "Example_service",
  • "description": "This is a example service",
  • "tags": {
    },
  • "yaml": "service:\n name: \"Example_service\"\n identifier: \"example_service\"\n tags: {}\n"
}
Response samples
{
  • "service": {
    },
  • "created": 1234567890,
  • "updated": 1234567890
}