Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Latest commit

 

History

History
335 lines (252 loc) · 10.3 KB

File metadata and controls

335 lines (252 loc) · 10.3 KB

LaunchDarkly.Api.Api.ProjectsApi

All URIs are relative to https://app.launchdarkly.com/api/v2

Method HTTP request Description
DeleteProject DELETE /projects/{projectKey} Delete a project by key. Caution- - deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.
GetProject GET /projects/{projectKey} Fetch a single project by key.
GetProjects GET /projects Returns a list of all projects in the account.
PatchProject PATCH /projects/{projectKey} Modify a project by ID.
PostProject POST /projects Create a new project with the given key and name.

DeleteProject

void DeleteProject (string projectKey)

Delete a project by key. Caution- - deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class DeleteProjectExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new ProjectsApi();
            var projectKey = projectKey_example;  // string | The project key, used to tie the flags together under one project so they can be managed together.

            try
            {
                // Delete a project by key. Caution- - deleting a project will delete all associated environments and feature flags. You cannot delete the last project in an account.
                apiInstance.DeleteProject(projectKey);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProjectsApi.DeleteProject: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
projectKey string The project key, used to tie the flags together under one project so they can be managed together.

Return type

void (empty response body)

Authorization

Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetProject

Project GetProject (string projectKey)

Fetch a single project by key.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class GetProjectExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new ProjectsApi();
            var projectKey = projectKey_example;  // string | The project key, used to tie the flags together under one project so they can be managed together.

            try
            {
                // Fetch a single project by key.
                Project result = apiInstance.GetProject(projectKey);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProjectsApi.GetProject: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
projectKey string The project key, used to tie the flags together under one project so they can be managed together.

Return type

Project

Authorization

Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetProjects

Projects GetProjects ()

Returns a list of all projects in the account.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class GetProjectsExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new ProjectsApi();

            try
            {
                // Returns a list of all projects in the account.
                Projects result = apiInstance.GetProjects();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProjectsApi.GetProjects: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

Projects

Authorization

Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PatchProject

Project PatchProject (string projectKey, List patchDelta)

Modify a project by ID.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class PatchProjectExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new ProjectsApi();
            var projectKey = projectKey_example;  // string | The project key, used to tie the flags together under one project so they can be managed together.
            var patchDelta = new List<PatchOperation>(); // List<PatchOperation> | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'

            try
            {
                // Modify a project by ID.
                Project result = apiInstance.PatchProject(projectKey, patchDelta);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProjectsApi.PatchProject: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
projectKey string The project key, used to tie the flags together under one project so they can be managed together.
patchDelta List Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/&#39;

Return type

Project

Authorization

Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostProject

Project PostProject (ProjectBody projectBody)

Create a new project with the given key and name.

Example

using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;

namespace Example
{
    public class PostProjectExample
    {
        public void main()
        {
            
            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

            var apiInstance = new ProjectsApi();
            var projectBody = new ProjectBody(); // ProjectBody | Project keys must be unique within an account.

            try
            {
                // Create a new project with the given key and name.
                Project result = apiInstance.PostProject(projectBody);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ProjectsApi.PostProject: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
projectBody ProjectBody Project keys must be unique within an account.

Return type

Project

Authorization

Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]