From eb9f1919b33f162fa8036e33b2bb7f09aa7bcc1b Mon Sep 17 00:00:00 2001 From: dvesperini Date: Fri, 14 Jun 2024 16:20:59 +0200 Subject: [PATCH] fix: latest code Signed-off-by: dvesperini --- examples/project.v1.test.js | 26 +--- project/v1.ts | 231 ++++++++++++++++++++++------ test/integration/project.v1.test.js | 34 +--- test/unit/project.v1.test.js | 44 ++---- 4 files changed, 204 insertions(+), 131 deletions(-) diff --git a/examples/project.v1.test.js b/examples/project.v1.test.js index 210e9ee..5395e3b 100644 --- a/examples/project.v1.test.js +++ b/examples/project.v1.test.js @@ -87,7 +87,7 @@ describe('ProjectV1', () => { // ProjectPrototypeDefinition const projectPrototypeDefinitionModel = { - name: 'acme-microservice2', + name: 'acme-microservice', description: 'A microservice to deploy on top of ACME infrastructure.', }; @@ -792,22 +792,10 @@ describe('ProjectV1', () => { value: 'cluster_id', }; - // StackDefinitionMemberInputPrototype - const stackDefinitionMemberInputPrototypeModel = { - name: 'region', - }; - - // StackDefinitionMemberPrototype - const stackDefinitionMemberPrototypeModel = { - name: 'foundation-deployable-architecture', - inputs: [stackDefinitionMemberInputPrototypeModel], - }; - // StackDefinitionBlockPrototype const stackDefinitionBlockPrototypeModel = { inputs: [stackDefinitionInputVariableModel], outputs: [stackDefinitionOutputVariableModel], - members: [stackDefinitionMemberPrototypeModel], }; const params = { @@ -880,21 +868,9 @@ describe('ProjectV1', () => { hidden: false, }; - // StackDefinitionMemberInputPrototype - const stackDefinitionMemberInputPrototypeModel = { - name: 'cluster_name', - }; - - // StackDefinitionMemberPrototype - const stackDefinitionMemberPrototypeModel = { - name: 'foundation-deployable-architecture', - inputs: [stackDefinitionMemberInputPrototypeModel], - }; - // StackDefinitionBlockPrototype const stackDefinitionBlockPrototypeModel = { inputs: [stackDefinitionInputVariableModel], - members: [stackDefinitionMemberPrototypeModel], }; const params = { diff --git a/project/v1.ts b/project/v1.ts index 77ee98d..4048ef4 100644 --- a/project/v1.ts +++ b/project/v1.ts @@ -1759,7 +1759,7 @@ namespace ProjectV1 { /** The definition of the project. */ definition: ProjectPrototypeDefinition; /** The IBM Cloud location where a resource is deployed. */ - location: string; + location: CreateProjectConstants.Location | string; /** The resource group name where the project's data and tools are created. */ resourceGroup: string; /** The project configurations. These configurations are included in the response of creating a project only if @@ -1773,6 +1773,18 @@ namespace ProjectV1 { headers?: OutgoingHttpHeaders; } + /** Constants for the `createProject` operation. */ + export namespace CreateProjectConstants { + /** The IBM Cloud location where a resource is deployed. */ + export enum Location { + US_SOUTH = 'us-south', + US_EAST = 'us-east', + EU_GB = 'eu-gb', + EU_DE = 'eu-de', + CA_TOR = 'ca-tor', + } + } + /** Parameters for the `listProjects` operation. */ export interface ListProjectsParams { /** The server uses this parameter to determine the first entry that is returned on the next page. If this @@ -2460,6 +2472,18 @@ namespace ProjectV1 { } } + /** The stack config parent of which this configuration is a member of. */ + export interface MemberOfDefinition { + /** The unique ID. */ + id: string; + /** The definition summary of the stack configuration. */ + definition: StackConfigDefinitionSummary; + /** The version of the stack configuration. */ + version: number; + /** A URL. */ + href: string; + } + /** OutputValue. */ export interface OutputValue { /** The variable name. */ @@ -2599,12 +2623,24 @@ namespace ProjectV1 { /** A unique ID for the instance of a compliance profile. */ instance_id?: string; /** The location of the compliance instance. */ - instance_location?: string; + instance_location?: ProjectComplianceProfile.Constants.InstanceLocation | string; /** A unique ID for the attachment to a compliance profile. */ attachment_id?: string; /** The name of the compliance profile. */ profile_name?: string; } + export namespace ProjectComplianceProfile { + export namespace Constants { + /** The location of the compliance instance. */ + export enum InstanceLocation { + US_SOUTH = 'us-south', + US_EAST = 'us-east', + EU_GB = 'eu-gb', + EU_DE = 'eu-de', + CA_TOR = 'ca-tor', + } + } + } /** The standard schema of a project configuration. */ export interface ProjectConfig { @@ -2652,10 +2688,16 @@ namespace ProjectV1 { state: ProjectConfig.Constants.State | string; /** The flag that indicates whether a configuration update is available. */ update_available?: boolean; - /** The template reference. */ - template?: ProjectObjectReference; + /** The stack definition identifier. */ + template_id?: string; + /** The stack config parent of which this configuration is a member of. */ + member_of?: MemberOfDefinition; /** A URL. */ href: string; + /** The configuration type. */ + deployment_model?: ProjectConfig.Constants.DeploymentModel | string; + /** Computed state code clarifying the prerequisites for validation for the configuration. */ + state_code?: ProjectConfig.Constants.StateCode | string; definition: ProjectConfigDefinitionResponse; /** A summary of a project configuration version. */ approved_version?: ProjectConfigVersionSummary; @@ -2684,6 +2726,20 @@ namespace ProjectV1 { APPLIED = 'applied', APPLY_FAILED = 'apply_failed', } + /** The configuration type. */ + export enum DeploymentModel { + PROJECT_DEPLOYED = 'project_deployed', + USER_DEPLOYED = 'user_deployed', + STACK = 'stack', + } + /** Computed state code clarifying the prerequisites for validation for the configuration. */ + export enum StateCode { + AWAITING_INPUT = 'awaiting_input', + AWAITING_PREREQUISITE = 'awaiting_prerequisite', + AWAITING_VALIDATION = 'awaiting_validation', + AWAITING_MEMBER_DEPLOYMENT = 'awaiting_member_deployment', + AWAITING_STACK_SETUP = 'awaiting_stack_setup', + } } } @@ -2987,10 +3043,16 @@ namespace ProjectV1 { state: ProjectConfigVersion.Constants.State | string; /** The flag that indicates whether a configuration update is available. */ update_available?: boolean; - /** The template reference. */ - template?: ProjectObjectReference; + /** The stack definition identifier. */ + template_id?: string; + /** The stack config parent of which this configuration is a member of. */ + member_of?: MemberOfDefinition; /** A URL. */ href: string; + /** The configuration type. */ + deployment_model?: ProjectConfigVersion.Constants.DeploymentModel | string; + /** Computed state code clarifying the prerequisites for validation for the configuration. */ + state_code?: ProjectConfigVersion.Constants.StateCode | string; definition: ProjectConfigDefinitionResponse; } export namespace ProjectConfigVersion { @@ -3015,6 +3077,20 @@ namespace ProjectV1 { APPLIED = 'applied', APPLY_FAILED = 'apply_failed', } + /** The configuration type. */ + export enum DeploymentModel { + PROJECT_DEPLOYED = 'project_deployed', + USER_DEPLOYED = 'user_deployed', + STACK = 'stack', + } + /** Computed state code clarifying the prerequisites for validation for the configuration. */ + export enum StateCode { + AWAITING_INPUT = 'awaiting_input', + AWAITING_PREREQUISITE = 'awaiting_prerequisite', + AWAITING_VALIDATION = 'awaiting_validation', + AWAITING_MEMBER_DEPLOYMENT = 'awaiting_member_deployment', + AWAITING_STACK_SETUP = 'awaiting_stack_setup', + } } } @@ -3044,6 +3120,8 @@ namespace ProjectV1 { definition: ProjectConfigVersionDefinitionSummary; /** The state of the configuration. */ state: ProjectConfigVersionSummary.Constants.State | string; + /** Computed state code clarifying the prerequisites for validation for the configuration. */ + state_code?: ProjectConfigVersionSummary.Constants.StateCode | string; /** The version number of the configuration. */ version: number; /** A URL. */ @@ -3071,6 +3149,14 @@ namespace ProjectV1 { APPLIED = 'applied', APPLY_FAILED = 'apply_failed', } + /** Computed state code clarifying the prerequisites for validation for the configuration. */ + export enum StateCode { + AWAITING_INPUT = 'awaiting_input', + AWAITING_PREREQUISITE = 'awaiting_prerequisite', + AWAITING_VALIDATION = 'awaiting_validation', + AWAITING_MEMBER_DEPLOYMENT = 'awaiting_member_deployment', + AWAITING_STACK_SETUP = 'awaiting_stack_setup', + } } } @@ -3090,6 +3176,8 @@ namespace ProjectV1 { * project without providing a description. */ description: string; + /** A boolean flag to enable auto deploy. */ + auto_deploy: boolean; /** A boolean flag to enable automatic drift detection. Use this field to run a daily check to compare your * configurations to your deployed resources to detect any difference. */ @@ -3102,6 +3190,18 @@ namespace ProjectV1 { name: string; } + /** The definition of the project. */ + export interface ProjectDefinitionSummary { + /** The name of the project. It's unique within the account across regions. */ + name: string; + /** The policy that indicates whether the resources are destroyed or not when a project is deleted. */ + destroy_on_delete: boolean; + /** A brief explanation of the project's use in the configuration of a deployable architecture. You can create a + * project without providing a description. + */ + description: string; + } + /** The ID of the deleted project. */ export interface ProjectDeleteResponse { /** The ID of the deleted project or configuration. */ @@ -3132,20 +3232,14 @@ namespace ProjectV1 { name: string; } - /** ProjectObjectReference. */ - export interface ProjectObjectReference { - /** The unique ID. */ - id: string; - /** A URL. */ - href: string; - } - /** The definition of the project. */ export interface ProjectPatchDefinitionBlock { /** The name of the project. It's unique within the account across regions. */ name?: string; /** The policy that indicates whether the resources are destroyed or not when a project is deleted. */ destroy_on_delete?: boolean; + /** A boolean flag to enable auto deploy. */ + auto_deploy?: boolean; /** A brief explanation of the project's use in the configuration of a deployable architecture. You can create a * project without providing a description. */ @@ -3166,6 +3260,8 @@ namespace ProjectV1 { * project without providing a description. */ description?: string; + /** A boolean flag to enable auto deploy. */ + auto_deploy?: boolean; /** A boolean flag to enable automatic drift detection. Use this field to run a daily check to compare your * configurations to your deployed resources to detect any difference. */ @@ -3211,7 +3307,7 @@ namespace ProjectV1 { /** A URL. */ href: string; /** The definition of the project. */ - definition: ProjectDefinitionProperties; + definition: ProjectDefinitionSummary; } export namespace ProjectSummary { export namespace Constants { @@ -3270,6 +3366,14 @@ namespace ProjectV1 { short_description?: string; } + /** The definition summary of the stack configuration. */ + export interface StackConfigDefinitionSummary { + /** The configuration name. It's unique within the account across projects and regions. */ + name: string; + /** The member deployabe architectures that are included in your stack. */ + members: StackConfigMember[]; + } + /** A member deployable architecture that is included in your stack. */ export interface StackConfigMember { /** The name matching the alias in the stack definition. */ @@ -3329,8 +3433,6 @@ namespace ProjectV1 { inputs?: StackDefinitionInputVariable[]; /** The outputs associated with this stack definition. */ outputs?: StackDefinitionOutputVariable[]; - /** Defines the member deployable architectures that are included in your stack. */ - members?: StackDefinitionMemberPrototype[]; } /** The payload for the stack definition export request. */ @@ -3387,11 +3489,11 @@ namespace ProjectV1 { name: string; /** The version locator of the member deployable architecture. */ version_locator: string; - /** The member input names to use for the stack definition. */ + /** The member inputs to use for the stack definition. */ inputs?: StackDefinitionMemberInput[]; } - /** The member input definition. */ + /** StackDefinitionMemberInput. */ export interface StackDefinitionMemberInput { /** The member input name to use. */ name: string; @@ -3399,20 +3501,6 @@ namespace ProjectV1 { value: any; } - /** The member input definition. */ - export interface StackDefinitionMemberInputPrototype { - /** The member input name to use. */ - name: string; - } - - /** Defines the input values from member deployable architectures that are included in the catalog entry when the stack is exported to a private catalog. */ - export interface StackDefinitionMemberPrototype { - /** The name matching the alias in the stack definition. */ - name: string; - /** The member input names to use for the deployable architecture stack definition. */ - inputs?: StackDefinitionMemberInputPrototype[]; - } - /** The configuration reference. */ export interface StackDefinitionMetadataConfiguration { /** The unique ID. */ @@ -3503,6 +3591,43 @@ namespace ProjectV1 { settings?: JsonObject; } + /** The name and description of a project configuration. */ + export interface ProjectConfigDefinitionPatchStackConfigDefinitionPropertiesPatch + extends ProjectConfigDefinitionPatch { + /** The profile that is required for compliance. */ + compliance_profile?: ProjectComplianceProfile; + /** A unique concatenation of the catalog ID and the version ID that identify the deployable architecture in the + * catalog. I you're importing from an existing Schematics workspace that is not backed by cart, a `locator_id` is + * required. If you're using a Schematics workspace that is backed by cart, a `locator_id` is not necessary because + * the Schematics workspace has one. + * > There are 3 scenarios: + * > 1. If only a `locator_id` is specified, a new Schematics workspace is instantiated with that `locator_id`. + * > 2. If only a schematics `workspace_crn` is specified, a `400` is returned if a `locator_id` is not found in + * the existing schematics workspace. + * > 3. If both a Schematics `workspace_crn` and a `locator_id` are specified, a `400` message is returned if the + * specified `locator_id` does not agree with the `locator_id` in the existing Schematics workspace. + * > For more information of creating a Schematics workspace, see [Creating workspaces and importing your Terraform + * template](/docs/schematics?topic=schematics-sch-create-wks). + */ + locator_id?: string; + /** The member deployabe architectures that are included in your stack. */ + members?: StackConfigMember[]; + /** A project configuration description. */ + description?: string; + /** The configuration name. It's unique within the account across projects and regions. */ + name?: string; + /** The ID of the project environment. */ + environment_id?: string; + /** The authorization details. You can authorize by using a trusted profile or an API key in Secrets Manager. */ + authorizations?: ProjectConfigAuth; + /** The input variables that are used for configuration definition and environment. */ + inputs?: JsonObject; + /** The Schematics environment variables to use to deploy the configuration. Settings are only available if they + * are specified when the configuration is initially created. + */ + settings?: JsonObject; + } + /** The description of a project configuration. */ export interface ProjectConfigDefinitionPrototypeDAConfigDefinitionPropertiesPrototype extends ProjectConfigDefinitionPrototype { @@ -3562,10 +3687,8 @@ namespace ProjectV1 { /** The description of a project configuration. */ export interface ProjectConfigDefinitionPrototypeStackConfigDefinitionProperties extends ProjectConfigDefinitionPrototype { - /** A project configuration description. */ - description?: string; - /** The configuration name. It's unique within the account across projects and regions. */ - name?: string; + /** The profile that is required for compliance. */ + compliance_profile?: ProjectComplianceProfile; /** A unique concatenation of the catalog ID and the version ID that identify the deployable architecture in the * catalog. I you're importing from an existing Schematics workspace that is not backed by cart, a `locator_id` is * required. If you're using a Schematics workspace that is backed by cart, a `locator_id` is not necessary because @@ -3580,12 +3703,22 @@ namespace ProjectV1 { * template](/docs/schematics?topic=schematics-sch-create-wks). */ locator_id?: string; + /** The member deployabe architectures that are included in your stack. */ + members?: StackConfigMember[]; + /** A project configuration description. */ + description?: string; + /** The configuration name. It's unique within the account across projects and regions. */ + name: string; /** The ID of the project environment. */ environment_id?: string; + /** The authorization details. You can authorize by using a trusted profile or an API key in Secrets Manager. */ + authorizations?: ProjectConfigAuth; /** The input variables that are used for configuration definition and environment. */ inputs?: JsonObject; - /** The member deployabe architectures that are included in your stack. */ - members?: StackConfigMember[]; + /** The Schematics environment variables to use to deploy the configuration. Settings are only available if they + * are specified when the configuration is initially created. + */ + settings?: JsonObject; } /** The description of a project configuration. */ @@ -3647,10 +3780,8 @@ namespace ProjectV1 { /** The description of a project configuration. */ export interface ProjectConfigDefinitionResponseStackConfigDefinitionProperties extends ProjectConfigDefinitionResponse { - /** A project configuration description. */ - description?: string; - /** The configuration name. It's unique within the account across projects and regions. */ - name?: string; + /** The profile that is required for compliance. */ + compliance_profile?: ProjectComplianceProfile; /** A unique concatenation of the catalog ID and the version ID that identify the deployable architecture in the * catalog. I you're importing from an existing Schematics workspace that is not backed by cart, a `locator_id` is * required. If you're using a Schematics workspace that is backed by cart, a `locator_id` is not necessary because @@ -3665,12 +3796,22 @@ namespace ProjectV1 { * template](/docs/schematics?topic=schematics-sch-create-wks). */ locator_id?: string; + /** The member deployabe architectures that are included in your stack. */ + members?: StackConfigMember[]; + /** A project configuration description. */ + description?: string; + /** The configuration name. It's unique within the account across projects and regions. */ + name: string; /** The ID of the project environment. */ environment_id?: string; + /** The authorization details. You can authorize by using a trusted profile or an API key in Secrets Manager. */ + authorizations?: ProjectConfigAuth; /** The input variables that are used for configuration definition and environment. */ inputs?: JsonObject; - /** The member deployabe architectures that are included in your stack. */ - members?: StackConfigMember[]; + /** The Schematics environment variables to use to deploy the configuration. Settings are only available if they + * are specified when the configuration is initially created. + */ + settings?: JsonObject; } /** The Code Risk Analyzer logs of the configuration based on Code Risk Analyzer version 2.0.4. */ diff --git a/test/integration/project.v1.test.js b/test/integration/project.v1.test.js index 30a293d..8c6f63b 100644 --- a/test/integration/project.v1.test.js +++ b/test/integration/project.v1.test.js @@ -55,9 +55,10 @@ describe('ProjectV1_integration', () => { // ProjectPrototypeDefinition const projectPrototypeDefinitionModel = { - name: 'acme-microservice7', + name: 'acme-microservice', destroy_on_delete: true, description: 'A microservice to deploy on top of ACME infrastructure.', + auto_deploy: false, monitoring_enabled: false, }; @@ -65,7 +66,7 @@ describe('ProjectV1_integration', () => { const projectComplianceProfileModel = { id: 'testString', instance_id: 'testString', - instance_location: 'testString', + instance_location: 'us-south', attachment_id: 'testString', profile_name: 'testString', }; @@ -138,7 +139,7 @@ describe('ProjectV1_integration', () => { const projectComplianceProfileModel = { id: 'testString', instance_id: 'testString', - instance_location: 'testString', + instance_location: 'us-south', attachment_id: 'testString', profile_name: 'testString', }; @@ -241,6 +242,7 @@ describe('ProjectV1_integration', () => { const projectPatchDefinitionBlockModel = { name: 'acme-microservice', destroy_on_delete: true, + auto_deploy: true, description: 'A microservice to deploy on top of ACME infrastructure.', monitoring_enabled: true, }; @@ -440,7 +442,7 @@ describe('ProjectV1_integration', () => { const projectComplianceProfileModel = { id: 'testString', instance_id: 'testString', - instance_location: 'testString', + instance_location: 'us-south', attachment_id: 'testString', profile_name: 'testString', }; @@ -596,22 +598,10 @@ describe('ProjectV1_integration', () => { value: 'cluster_id', }; - // StackDefinitionMemberInputPrototype - const stackDefinitionMemberInputPrototypeModel = { - name: 'region', - }; - - // StackDefinitionMemberPrototype - const stackDefinitionMemberPrototypeModel = { - name: 'foundation-deployable-architecture', - inputs: [stackDefinitionMemberInputPrototypeModel], - }; - // StackDefinitionBlockPrototype const stackDefinitionBlockPrototypeModel = { inputs: [stackDefinitionInputVariableModel], outputs: [stackDefinitionOutputVariableModel], - members: [stackDefinitionMemberPrototypeModel], }; const params = { @@ -657,22 +647,10 @@ describe('ProjectV1_integration', () => { value: 'testString', }; - // StackDefinitionMemberInputPrototype - const stackDefinitionMemberInputPrototypeModel = { - name: 'cluster_name', - }; - - // StackDefinitionMemberPrototype - const stackDefinitionMemberPrototypeModel = { - name: 'foundation-deployable-architecture', - inputs: [stackDefinitionMemberInputPrototypeModel], - }; - // StackDefinitionBlockPrototype const stackDefinitionBlockPrototypeModel = { inputs: [stackDefinitionInputVariableModel], outputs: [stackDefinitionOutputVariableModel], - members: [stackDefinitionMemberPrototypeModel], }; const params = { diff --git a/test/unit/project.v1.test.js b/test/unit/project.v1.test.js index c8b35be..29505b2 100644 --- a/test/unit/project.v1.test.js +++ b/test/unit/project.v1.test.js @@ -129,6 +129,7 @@ describe('ProjectV1', () => { name: 'acme-microservice', destroy_on_delete: true, description: 'A microservice to deploy on top of ACME infrastructure.', + auto_deploy: false, monitoring_enabled: false, }; @@ -136,7 +137,7 @@ describe('ProjectV1', () => { const projectComplianceProfileModel = { id: 'testString', instance_id: 'testString', - instance_location: 'testString', + instance_location: 'us-south', attachment_id: 'testString', profile_name: 'testString', }; @@ -355,9 +356,9 @@ describe('ProjectV1', () => { const serviceUrl = projectServiceOptions.url; const path = '/v1/projects'; const mockPagerResponse1 = - '{"next":{"href":"https://myhost.com/somePath?token=1"},"projects":[{"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::","created_at":"2019-01-01T12:00:00.000Z","cumulative_needs_attention_view":[{"event":"event","event_id":"event_id","config_id":"config_id","config_version":14}],"cumulative_needs_attention_view_error":false,"id":"id","location":"location","resource_group_id":"resource_group_id","state":"ready","href":"href","definition":{"name":"name","destroy_on_delete":false,"description":"description","monitoring_enabled":false}}],"total_count":2,"limit":1}'; + '{"next":{"href":"https://myhost.com/somePath?token=1"},"projects":[{"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::","created_at":"2019-01-01T12:00:00.000Z","cumulative_needs_attention_view":[{"event":"event","event_id":"event_id","config_id":"config_id","config_version":14}],"cumulative_needs_attention_view_error":false,"id":"id","location":"location","resource_group_id":"resource_group_id","state":"ready","href":"href","definition":{"name":"name","destroy_on_delete":false,"description":"description"}}],"total_count":2,"limit":1}'; const mockPagerResponse2 = - '{"projects":[{"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::","created_at":"2019-01-01T12:00:00.000Z","cumulative_needs_attention_view":[{"event":"event","event_id":"event_id","config_id":"config_id","config_version":14}],"cumulative_needs_attention_view_error":false,"id":"id","location":"location","resource_group_id":"resource_group_id","state":"ready","href":"href","definition":{"name":"name","destroy_on_delete":false,"description":"description","monitoring_enabled":false}}],"total_count":2,"limit":1}'; + '{"projects":[{"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::","created_at":"2019-01-01T12:00:00.000Z","cumulative_needs_attention_view":[{"event":"event","event_id":"event_id","config_id":"config_id","config_version":14}],"cumulative_needs_attention_view_error":false,"id":"id","location":"location","resource_group_id":"resource_group_id","state":"ready","href":"href","definition":{"name":"name","destroy_on_delete":false,"description":"description"}}],"total_count":2,"limit":1}'; beforeEach(() => { unmock_createRequest(); @@ -492,6 +493,7 @@ describe('ProjectV1', () => { const projectPatchDefinitionBlockModel = { name: 'acme-microservice', destroy_on_delete: true, + auto_deploy: true, description: 'A microservice to deploy on top of ACME infrastructure.', monitoring_enabled: true, }; @@ -880,9 +882,9 @@ describe('ProjectV1', () => { const serviceUrl = projectServiceOptions.url; const path = '/v1/projects/testString/environments'; const mockPagerResponse1 = - '{"next":{"href":"https://myhost.com/somePath?token=1"},"environments":[{"id":"id","project":{"id":"id","href":"href","definition":{"name":"name"},"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"},"created_at":"2019-01-01T12:00:00.000Z","target_account":"target_account","modified_at":"2019-01-01T12:00:00.000Z","href":"href","definition":{"description":"description","name":"name","authorizations":{"trusted_profile_id":"trusted_profile_id","method":"api_key","api_key":"api_key"},"inputs":{"anyKey":"anyValue"},"compliance_profile":{"id":"id","instance_id":"instance_id","instance_location":"instance_location","attachment_id":"attachment_id","profile_name":"profile_name"}}}],"total_count":2,"limit":1}'; + '{"next":{"href":"https://myhost.com/somePath?token=1"},"environments":[{"id":"id","project":{"id":"id","href":"href","definition":{"name":"name"},"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"},"created_at":"2019-01-01T12:00:00.000Z","target_account":"target_account","modified_at":"2019-01-01T12:00:00.000Z","href":"href","definition":{"description":"description","name":"name","authorizations":{"trusted_profile_id":"trusted_profile_id","method":"api_key","api_key":"api_key"},"inputs":{"anyKey":"anyValue"},"compliance_profile":{"id":"id","instance_id":"instance_id","instance_location":"us-south","attachment_id":"attachment_id","profile_name":"profile_name"}}}],"total_count":2,"limit":1}'; const mockPagerResponse2 = - '{"environments":[{"id":"id","project":{"id":"id","href":"href","definition":{"name":"name"},"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"},"created_at":"2019-01-01T12:00:00.000Z","target_account":"target_account","modified_at":"2019-01-01T12:00:00.000Z","href":"href","definition":{"description":"description","name":"name","authorizations":{"trusted_profile_id":"trusted_profile_id","method":"api_key","api_key":"api_key"},"inputs":{"anyKey":"anyValue"},"compliance_profile":{"id":"id","instance_id":"instance_id","instance_location":"instance_location","attachment_id":"attachment_id","profile_name":"profile_name"}}}],"total_count":2,"limit":1}'; + '{"environments":[{"id":"id","project":{"id":"id","href":"href","definition":{"name":"name"},"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"},"created_at":"2019-01-01T12:00:00.000Z","target_account":"target_account","modified_at":"2019-01-01T12:00:00.000Z","href":"href","definition":{"description":"description","name":"name","authorizations":{"trusted_profile_id":"trusted_profile_id","method":"api_key","api_key":"api_key"},"inputs":{"anyKey":"anyValue"},"compliance_profile":{"id":"id","instance_id":"instance_id","instance_location":"us-south","attachment_id":"attachment_id","profile_name":"profile_name"}}}],"total_count":2,"limit":1}'; beforeEach(() => { unmock_createRequest(); @@ -1248,7 +1250,7 @@ describe('ProjectV1', () => { const projectComplianceProfileModel = { id: 'testString', instance_id: 'testString', - instance_location: 'testString', + instance_location: 'us-south', attachment_id: 'testString', profile_name: 'testString', }; @@ -1468,9 +1470,9 @@ describe('ProjectV1', () => { const serviceUrl = projectServiceOptions.url; const path = '/v1/projects/testString/configs'; const mockPagerResponse1 = - '{"next":{"href":"https://myhost.com/somePath?token=1"},"configs":[{"approved_version":{"definition":{"environment_id":"environment_id","locator_id":"locator_id"},"state":"approved","version":7,"href":"href"},"deployed_version":{"definition":{"environment_id":"environment_id","locator_id":"locator_id"},"state":"approved","version":7,"href":"href"},"id":"id","version":7,"state":"approved","created_at":"2019-01-01T12:00:00.000Z","modified_at":"2019-01-01T12:00:00.000Z","href":"href","definition":{"description":"description","name":"name","locator_id":"locator_id"},"project":{"id":"id","href":"href","definition":{"name":"name"},"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"},"deployment_model":"project_deployed"}],"total_count":2,"limit":1}'; + '{"next":{"href":"https://myhost.com/somePath?token=1"},"configs":[{"approved_version":{"definition":{"environment_id":"environment_id","locator_id":"locator_id"},"state":"approved","state_code":"awaiting_input","version":7,"href":"href"},"deployed_version":{"definition":{"environment_id":"environment_id","locator_id":"locator_id"},"state":"approved","state_code":"awaiting_input","version":7,"href":"href"},"id":"id","version":7,"state":"approved","created_at":"2019-01-01T12:00:00.000Z","modified_at":"2019-01-01T12:00:00.000Z","href":"href","definition":{"description":"description","name":"name","locator_id":"locator_id"},"project":{"id":"id","href":"href","definition":{"name":"name"},"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"},"deployment_model":"project_deployed"}],"total_count":2,"limit":1}'; const mockPagerResponse2 = - '{"configs":[{"approved_version":{"definition":{"environment_id":"environment_id","locator_id":"locator_id"},"state":"approved","version":7,"href":"href"},"deployed_version":{"definition":{"environment_id":"environment_id","locator_id":"locator_id"},"state":"approved","version":7,"href":"href"},"id":"id","version":7,"state":"approved","created_at":"2019-01-01T12:00:00.000Z","modified_at":"2019-01-01T12:00:00.000Z","href":"href","definition":{"description":"description","name":"name","locator_id":"locator_id"},"project":{"id":"id","href":"href","definition":{"name":"name"},"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"},"deployment_model":"project_deployed"}],"total_count":2,"limit":1}'; + '{"configs":[{"approved_version":{"definition":{"environment_id":"environment_id","locator_id":"locator_id"},"state":"approved","state_code":"awaiting_input","version":7,"href":"href"},"deployed_version":{"definition":{"environment_id":"environment_id","locator_id":"locator_id"},"state":"approved","state_code":"awaiting_input","version":7,"href":"href"},"id":"id","version":7,"state":"approved","created_at":"2019-01-01T12:00:00.000Z","modified_at":"2019-01-01T12:00:00.000Z","href":"href","definition":{"description":"description","name":"name","locator_id":"locator_id"},"project":{"id":"id","href":"href","definition":{"name":"name"},"crn":"crn:v1:staging:public:project:us-south:a/4e1c48fcf8ac33c0a2441e4139f189ae:bf40ad13-b107-446a-8286-c6d576183bb1::"},"deployment_model":"project_deployed"}],"total_count":2,"limit":1}'; beforeEach(() => { unmock_createRequest(); @@ -1612,7 +1614,7 @@ describe('ProjectV1', () => { const projectComplianceProfileModel = { id: 'testString', instance_id: 'testString', - instance_location: 'testString', + instance_location: 'us-south', attachment_id: 'testString', profile_name: 'testString', }; @@ -2514,22 +2516,10 @@ describe('ProjectV1', () => { value: 'cluster_id', }; - // StackDefinitionMemberInputPrototype - const stackDefinitionMemberInputPrototypeModel = { - name: 'region', - }; - - // StackDefinitionMemberPrototype - const stackDefinitionMemberPrototypeModel = { - name: 'foundation-deployable-architecture', - inputs: [stackDefinitionMemberInputPrototypeModel], - }; - // StackDefinitionBlockPrototype const stackDefinitionBlockPrototypeModel = { inputs: [stackDefinitionInputVariableModel], outputs: [stackDefinitionOutputVariableModel], - members: [stackDefinitionMemberPrototypeModel], }; function __createStackDefinitionTest() { @@ -2744,22 +2734,10 @@ describe('ProjectV1', () => { value: 'testString', }; - // StackDefinitionMemberInputPrototype - const stackDefinitionMemberInputPrototypeModel = { - name: 'cluster_name', - }; - - // StackDefinitionMemberPrototype - const stackDefinitionMemberPrototypeModel = { - name: 'foundation-deployable-architecture', - inputs: [stackDefinitionMemberInputPrototypeModel], - }; - // StackDefinitionBlockPrototype const stackDefinitionBlockPrototypeModel = { inputs: [stackDefinitionInputVariableModel], outputs: [stackDefinitionOutputVariableModel], - members: [stackDefinitionMemberPrototypeModel], }; function __updateStackDefinitionTest() {