All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| patch_teams | PATCH /api/v2/teams | Update teams |
BulkEditTeamsRep patch_teams(teams_patch_input)
Update teams
Perform a partial update to multiple teams. Updating teams uses the semantic patch format.
To make a semantic patch request, you must append domain-model=launchdarkly.semanticpatch to your Content-Type header. To learn more, read Updates using semantic patch.
Semantic patch requests support the following kind instructions for updating teams.
Click to expand instructions for updating teams
Add the members to teams.
memberIDs: List of member IDs to add.teamKeys: List of teams to update.
Here's an example:
{
"instructions": [{
"kind": "addMembersToTeams",
"memberIDs": [
"1234a56b7c89d012345e678f"
],
"teamKeys": [
"example-team-1",
"example-team-2"
]
}]
}Add all members to the team. Members that match any of the filters are excluded from the update.
teamKeys: List of teams to update.filterLastSeen: (Optional) A JSON object with one of the following formats:{"never": true}- Members that have never been active, such as those who have not accepted their invitation to LaunchDarkly, or have not logged in after being provisioned via SCIM.{"noData": true}- Members that have not been active since LaunchDarkly began recording last seen timestamps.{"before": 1608672063611}- Members that have not been active since the provided value, which should be a timestamp in Unix epoch milliseconds.
filterQuery: (Optional) A string that matches against the members' emails and names. It is not case sensitive.filterRoles: (Optional) A|separated list of roles and custom roles. For the purposes of this filtering,Ownercounts asAdmin.filterTeamKey: (Optional) A string that matches against the key of the team the members belong to. It is not case sensitive.ignoredMemberIDs: (Optional) A list of member IDs.
Here's an example:
{
"instructions": [{
"kind": "addAllMembersToTeams",
"teamKeys": [
"example-team-1",
"example-team-2"
],
"filterLastSeen": { "never": true }
}]
}- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.bulk_edit_teams_rep import BulkEditTeamsRep
from launchdarkly_api.models.teams_patch_input import TeamsPatchInput
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.TeamsBetaApi(api_client)
teams_patch_input = {"comment":"Optional comment about the update","instructions":[{"kind":"addMembersToTeams","memberIDs":["1234a56b7c89d012345e678f"],"teamKeys":["example-team-1","example-team-2"]}]} # TeamsPatchInput |
try:
# Update teams
api_response = api_instance.patch_teams(teams_patch_input)
print("The response of TeamsBetaApi->patch_teams:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TeamsBetaApi->patch_teams: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| teams_patch_input | TeamsPatchInput |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Teams response | - |
| 400 | Invalid request | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 409 | Status conflict | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]