Edit

Share via


ManagementRestClient class

Base class that should be used (derived from) to make requests to VSS REST apis

Extends

Constructors

ManagementRestClient(IVssRestClientOptions)

Methods

createBillingSnapshot3(MeterUsageForPlan, Plan)

During multi-org billing computation in primary scale unit(EUS21), this API is used to create billing snapshot for a specific org. Primary scale unit will call this API for each org in different scsle units to create billing snapshot. Data will be stored in the org specific partition DB -> billing snapshot table. This is needed as customers will fetch billing data from their org specific partition DB.

getBillableCommitterDetails3(Plan, Date)

Get all billable committers details, including those not matched with a VSID.

getEstimatedBillableCommittersDetailsForRepo3(string, string, Plan)

Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this repository.

getEstimatedBillablePushersDetailsForOrg3(Plan)

Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this organization.

getEstimatedBillablePushersDetailsForProject3(string, Plan)

Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this project.

getLastMeterUsage3(Plan)
getMeterUsage3(Plan, Date)

Get commiters used when calculating billing information.

getOrgEnablementStatus3(boolean)

Get the current status of Advanced Security for the organization

getProjectEnablementStatus3(string, boolean)

Get the current status of Advanced Security for a project

getRepoEnablementStatus3(string, string, boolean)

Determines if Code Security, Secret Protection, and their features are enabled for the repository.

updateOrgEnablementStatus3(OrgEnablementSettings)

Update the status of Advanced Security for the organization

updateProjectEnablementStatus3(ProjectEnablementSettings, string)

Update the status of Advanced Security for the project

updateRepoAdvSecEnablementStatus3(RepoEnablementSettings, string, string)

Update the enablement status of Code Security and Secret Protection, along with their respective features, for a given repository.

Constructor Details

ManagementRestClient(IVssRestClientOptions)

new ManagementRestClient(options: IVssRestClientOptions)

Parameters

Method Details

createBillingSnapshot3(MeterUsageForPlan, Plan)

During multi-org billing computation in primary scale unit(EUS21), this API is used to create billing snapshot for a specific org. Primary scale unit will call this API for each org in different scsle units to create billing snapshot. Data will be stored in the org specific partition DB -> billing snapshot table. This is needed as customers will fetch billing data from their org specific partition DB.

function createBillingSnapshot3(meterUsage: MeterUsageForPlan, plan: Plan): Promise<void>

Parameters

meterUsage
MeterUsageForPlan
plan
Plan

Returns

Promise<void>

getBillableCommitterDetails3(Plan, Date)

Get all billable committers details, including those not matched with a VSID.

function getBillableCommitterDetails3(plan: Plan, billingDate?: Date): Promise<BillableCommitterDetails[]>

Parameters

plan
Plan

The plan to query. Plans supported: CodeSecurity and SecretProtection. This is a mandatory parameter.

billingDate

Date

The date to query, or if not provided, today

Returns

getEstimatedBillableCommittersDetailsForRepo3(string, string, Plan)

Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this repository.

function getEstimatedBillableCommittersDetailsForRepo3(project: string, repository: string, plan?: Plan): Promise<MeterUsageEstimate>

Parameters

project

string

Project ID or project name

repository

string

The name or ID of the repository

plan
Plan

The plan to query.

Returns

getEstimatedBillablePushersDetailsForOrg3(Plan)

Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this organization.

function getEstimatedBillablePushersDetailsForOrg3(plan: Plan): Promise<MeterUsageEstimate>

Parameters

plan
Plan

The plan to query.

Returns

getEstimatedBillablePushersDetailsForProject3(string, Plan)

Estimate the pushers that would be added to the customer's usage if Advanced Security was enabled for this project.

function getEstimatedBillablePushersDetailsForProject3(project: string, plan?: Plan): Promise<MeterUsageEstimate>

Parameters

project

string

Project ID or project name

plan
Plan

Returns

getLastMeterUsage3(Plan)

function getLastMeterUsage3(plan: Plan): Promise<MeterUsageForPlan>

Parameters

plan
Plan

Returns

getMeterUsage3(Plan, Date)

Get commiters used when calculating billing information.

function getMeterUsage3(plan: Plan, billingDate?: Date): Promise<MeterUsageForPlan>

Parameters

plan
Plan

The plan to query. Plans supported: CodeSecurity and SecretProtection. This is a mandatory parameter.

billingDate

Date

The date to query, or if not provided, today

Returns

getOrgEnablementStatus3(boolean)

Get the current status of Advanced Security for the organization

function getOrgEnablementStatus3(includeAllProperties?: boolean): Promise<OrgEnablementSettings>

Parameters

includeAllProperties

boolean

When true, also determine if pushes are blocked if they contain secrets

Returns

getProjectEnablementStatus3(string, boolean)

Get the current status of Advanced Security for a project

function getProjectEnablementStatus3(project: string, includeAllProperties?: boolean): Promise<ProjectEnablementSettings>

Parameters

project

string

Project ID or project name

includeAllProperties

boolean

When true, also determine if pushes are blocked if they contain secrets

Returns

getRepoEnablementStatus3(string, string, boolean)

Determines if Code Security, Secret Protection, and their features are enabled for the repository.

function getRepoEnablementStatus3(project: string, repository: string, includeAllProperties?: boolean): Promise<RepoEnablementSettings>

Parameters

project

string

Project ID or project name

repository

string

The name or ID of the repository

includeAllProperties

boolean

When true, will also determine if pushes are blocked when secrets are detected

Returns

updateOrgEnablementStatus3(OrgEnablementSettings)

Update the status of Advanced Security for the organization

function updateOrgEnablementStatus3(orgEnablementSettings: OrgEnablementSettings): Promise<void>

Parameters

orgEnablementSettings
OrgEnablementSettings

The new status

Returns

Promise<void>

updateProjectEnablementStatus3(ProjectEnablementSettings, string)

Update the status of Advanced Security for the project

function updateProjectEnablementStatus3(projectEnablementSettings: ProjectEnablementSettings, project: string): Promise<void>

Parameters

projectEnablementSettings
ProjectEnablementSettings

The new status

project

string

Project ID or project name

Returns

Promise<void>

updateRepoAdvSecEnablementStatus3(RepoEnablementSettings, string, string)

Update the enablement status of Code Security and Secret Protection, along with their respective features, for a given repository.

function updateRepoAdvSecEnablementStatus3(savedAdvSecEnablementStatus: RepoEnablementSettings, project: string, repository: string): Promise<void>

Parameters

savedAdvSecEnablementStatus
RepoEnablementSettings

new status

project

string

Project ID or project name

repository

string

Name or ID of the repository

Returns

Promise<void>