Skip to content

Commit ca8766d

Browse files
committed
using ListApps alone
1 parent 41a5cef commit ca8766d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/core/src/awsService/sagemaker/sagemakerSpace.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,14 @@ export class SagemakerSpace {
116116
// If the App is not null and AppName exists -> use DescribeApp API (requires AppName as a parameter)
117117
// otherwise -> use ListApp API, with given DomainId and SpaceName
118118
let app
119-
if (this.spaceApp.App?.AppName) {
120-
app = await this.client.describeApp({
121-
DomainId: this.spaceApp.DomainId,
122-
AppName: this.spaceApp.App?.AppName,
123-
AppType: this.spaceApp?.SpaceSettingsSummary?.AppType,
124-
SpaceName: this.spaceApp.SpaceName,
125-
})
126-
} else if (this.spaceApp.DomainId && this.spaceApp.SpaceName) {
119+
if (this.spaceApp.DomainId && this.spaceApp.SpaceName) {
127120
app = await this.client.listAppForSpace(this.spaceApp.DomainId, this.spaceApp.SpaceName)
128121
} else {
129122
logger.error(
130-
`updateSpaceAppStatus: unable to get app, [AppName: ${this.spaceApp.App?.AppName}], [DomainId: ${this.spaceApp.DomainId}], [SpaceName: ${this.spaceApp.SpaceName}]`
123+
`updateSpaceAppStatus: unable to get app, [DomainId: ${this.spaceApp.DomainId}], [SpaceName: ${this.spaceApp.SpaceName}]`
131124
)
132125
throw new ToolkitError(
133-
`Cannot update app status without [AppName: ${this.spaceApp.App?.AppName}] or [DomainId: ${this.spaceApp.DomainId} and SpaceName: ${this.spaceApp.SpaceName}]`
126+
`Cannot update app status without [DomainId: ${this.spaceApp.DomainId} and SpaceName: ${this.spaceApp.SpaceName}]`
134127
)
135128
}
136129

0 commit comments

Comments
 (0)