FeatureManagementRestClient class

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

Extends

Constructors

FeatureManagementRestClient(IVssRestClientOptions)

Methods

getFeature(string)

Get a specific feature by its id

getFeatures(string)

Get a list of all defined features

getFeatureState(string, string)

Get the state of the specified feature for the given user/all-users scope

getFeatureStateForScope(string, string, string, string)

Get the state of the specified feature for the given named scope

queryFeatureStates(ContributedFeatureStateQuery)

Get the effective state for a list of feature ids

queryFeatureStatesForDefaultScope(ContributedFeatureStateQuery, string)

Get the states of the specified features for the default scope

queryFeatureStatesForNamedScope(ContributedFeatureStateQuery, string, string, string)

Get the states of the specified features for the specific named scope

setFeatureState(ContributedFeatureState, string, string, string, string)

Set the state of a feature

setFeatureStateForScope(ContributedFeatureState, string, string, string, string, string, string)

Set the state of a feature at a specific scope

Constructor Details

FeatureManagementRestClient(IVssRestClientOptions)

new FeatureManagementRestClient(options: IVssRestClientOptions)

Parameters

Method Details

getFeature(string)

Get a specific feature by its id

function getFeature(featureId: string): Promise<ContributedFeature>

Parameters

featureId

string

The contribution id of the feature

Returns

getFeatures(string)

Get a list of all defined features

function getFeatures(targetContributionId?: string): Promise<ContributedFeature[]>

Parameters

targetContributionId

string

Optional target contribution. If null/empty, return all features. If specified include the features that target the specified contribution.

Returns

Promise<ContributedFeature[]>

getFeatureState(string, string)

Get the state of the specified feature for the given user/all-users scope

function getFeatureState(featureId: string, userScope: string): Promise<ContributedFeatureState>

Parameters

featureId

string

Contribution id of the feature

userScope

string

User-Scope at which to get the value. Should be "me" for the current user or "host" for all users.

Returns

getFeatureStateForScope(string, string, string, string)

Get the state of the specified feature for the given named scope

function getFeatureStateForScope(featureId: string, userScope: string, scopeName: string, scopeValue: string): Promise<ContributedFeatureState>

Parameters

featureId

string

Contribution id of the feature

userScope

string

User-Scope at which to get the value. Should be "me" for the current user or "host" for all users.

scopeName

string

Scope at which to get the feature setting for (e.g. "project" or "team")

scopeValue

string

Value of the scope (e.g. the project or team id)

Returns

queryFeatureStates(ContributedFeatureStateQuery)

Get the effective state for a list of feature ids

function queryFeatureStates(query: ContributedFeatureStateQuery): Promise<ContributedFeatureStateQuery>

Parameters

query
ContributedFeatureStateQuery

Features to query along with current scope values

Returns

queryFeatureStatesForDefaultScope(ContributedFeatureStateQuery, string)

Get the states of the specified features for the default scope

function queryFeatureStatesForDefaultScope(query: ContributedFeatureStateQuery, userScope: string): Promise<ContributedFeatureStateQuery>

Parameters

query
ContributedFeatureStateQuery

Query describing the features to query.

userScope

string

Returns

queryFeatureStatesForNamedScope(ContributedFeatureStateQuery, string, string, string)

Get the states of the specified features for the specific named scope

function queryFeatureStatesForNamedScope(query: ContributedFeatureStateQuery, userScope: string, scopeName: string, scopeValue: string): Promise<ContributedFeatureStateQuery>

Parameters

query
ContributedFeatureStateQuery

Query describing the features to query.

userScope

string

scopeName

string

scopeValue

string

Returns

setFeatureState(ContributedFeatureState, string, string, string, string)

Set the state of a feature

function setFeatureState(feature: ContributedFeatureState, featureId: string, userScope: string, reason?: string, reasonCode?: string): Promise<ContributedFeatureState>

Parameters

feature
ContributedFeatureState

Posted feature state object. Should specify the effective value.

featureId

string

Contribution id of the feature

userScope

string

User-Scope at which to set the value. Should be "me" for the current user or "host" for all users.

reason

string

Reason for changing the state

reasonCode

string

Short reason code

Returns

setFeatureStateForScope(ContributedFeatureState, string, string, string, string, string, string)

Set the state of a feature at a specific scope

function setFeatureStateForScope(feature: ContributedFeatureState, featureId: string, userScope: string, scopeName: string, scopeValue: string, reason?: string, reasonCode?: string): Promise<ContributedFeatureState>

Parameters

feature
ContributedFeatureState

Posted feature state object. Should specify the effective value.

featureId

string

Contribution id of the feature

userScope

string

User-Scope at which to set the value. Should be "me" for the current user or "host" for all users.

scopeName

string

Scope at which to get the feature setting for (e.g. "project" or "team")

scopeValue

string

Value of the scope (e.g. the project or team id)

reason

string

Reason for changing the state

reasonCode

string

Short reason code

Returns