Best JavaScript code snippet using best
migrationhub.d.ts
Source:migrationhub.d.ts
1import {Request} from '../lib/request';2import {Response} from '../lib/response';3import {AWSError} from '../lib/error';4import {Service} from '../lib/service';5import {ServiceConfigurationOptions} from '../lib/service';6import {ConfigBase as Config} from '../lib/config-base';7interface Blob {}8declare class MigrationHub extends Service {9 /**10 * Constructs a service object. This object has one method for each API operation.11 */12 constructor(options?: MigrationHub.Types.ClientConfiguration)13 config: Config & MigrationHub.Types.ClientConfiguration;14 /**15 * Associates a created artifact of an AWS cloud resource, the target receiving the migration, with the migration task performed by a migration tool. This API has the following traits: Migration tools can call the AssociateCreatedArtifact operation to indicate which AWS artifact is associated with a migration task. The created artifact name must be provided in ARN (Amazon Resource Name) format which will contain information about type and region; for example: arn:aws:ec2:us-east-1:488216288981:image/ami-6d0ba87b. Examples of the AWS resource behind the created artifact are, AMI's, EC2 instance, or DMS endpoint, etc. 16 */17 associateCreatedArtifact(params: MigrationHub.Types.AssociateCreatedArtifactRequest, callback?: (err: AWSError, data: MigrationHub.Types.AssociateCreatedArtifactResult) => void): Request<MigrationHub.Types.AssociateCreatedArtifactResult, AWSError>;18 /**19 * Associates a created artifact of an AWS cloud resource, the target receiving the migration, with the migration task performed by a migration tool. This API has the following traits: Migration tools can call the AssociateCreatedArtifact operation to indicate which AWS artifact is associated with a migration task. The created artifact name must be provided in ARN (Amazon Resource Name) format which will contain information about type and region; for example: arn:aws:ec2:us-east-1:488216288981:image/ami-6d0ba87b. Examples of the AWS resource behind the created artifact are, AMI's, EC2 instance, or DMS endpoint, etc. 20 */21 associateCreatedArtifact(callback?: (err: AWSError, data: MigrationHub.Types.AssociateCreatedArtifactResult) => void): Request<MigrationHub.Types.AssociateCreatedArtifactResult, AWSError>;22 /**23 * Associates a discovered resource ID from Application Discovery Service with a migration task.24 */25 associateDiscoveredResource(params: MigrationHub.Types.AssociateDiscoveredResourceRequest, callback?: (err: AWSError, data: MigrationHub.Types.AssociateDiscoveredResourceResult) => void): Request<MigrationHub.Types.AssociateDiscoveredResourceResult, AWSError>;26 /**27 * Associates a discovered resource ID from Application Discovery Service with a migration task.28 */29 associateDiscoveredResource(callback?: (err: AWSError, data: MigrationHub.Types.AssociateDiscoveredResourceResult) => void): Request<MigrationHub.Types.AssociateDiscoveredResourceResult, AWSError>;30 /**31 * Creates a progress update stream which is an AWS resource used for access control as well as a namespace for migration task names that is implicitly linked to your AWS account. It must uniquely identify the migration tool as it is used for all updates made by the tool; however, it does not need to be unique for each AWS account because it is scoped to the AWS account.32 */33 createProgressUpdateStream(params: MigrationHub.Types.CreateProgressUpdateStreamRequest, callback?: (err: AWSError, data: MigrationHub.Types.CreateProgressUpdateStreamResult) => void): Request<MigrationHub.Types.CreateProgressUpdateStreamResult, AWSError>;34 /**35 * Creates a progress update stream which is an AWS resource used for access control as well as a namespace for migration task names that is implicitly linked to your AWS account. It must uniquely identify the migration tool as it is used for all updates made by the tool; however, it does not need to be unique for each AWS account because it is scoped to the AWS account.36 */37 createProgressUpdateStream(callback?: (err: AWSError, data: MigrationHub.Types.CreateProgressUpdateStreamResult) => void): Request<MigrationHub.Types.CreateProgressUpdateStreamResult, AWSError>;38 /**39 * Deletes a progress update stream, including all of its tasks, which was previously created as an AWS resource used for access control. This API has the following traits: The only parameter needed for DeleteProgressUpdateStream is the stream name (same as a CreateProgressUpdateStream call). The call will return, and a background process will asynchronously delete the stream and all of its resources (tasks, associated resources, resource attributes, created artifacts). If the stream takes time to be deleted, it might still show up on a ListProgressUpdateStreams call. CreateProgressUpdateStream, ImportMigrationTask, NotifyMigrationTaskState, and all Associate[*] APIs related to the tasks belonging to the stream will throw "InvalidInputException" if the stream of the same name is in the process of being deleted. Once the stream and all of its resources are deleted, CreateProgressUpdateStream for a stream of the same name will succeed, and that stream will be an entirely new logical resource (without any resources associated with the old stream). 40 */41 deleteProgressUpdateStream(params: MigrationHub.Types.DeleteProgressUpdateStreamRequest, callback?: (err: AWSError, data: MigrationHub.Types.DeleteProgressUpdateStreamResult) => void): Request<MigrationHub.Types.DeleteProgressUpdateStreamResult, AWSError>;42 /**43 * Deletes a progress update stream, including all of its tasks, which was previously created as an AWS resource used for access control. This API has the following traits: The only parameter needed for DeleteProgressUpdateStream is the stream name (same as a CreateProgressUpdateStream call). The call will return, and a background process will asynchronously delete the stream and all of its resources (tasks, associated resources, resource attributes, created artifacts). If the stream takes time to be deleted, it might still show up on a ListProgressUpdateStreams call. CreateProgressUpdateStream, ImportMigrationTask, NotifyMigrationTaskState, and all Associate[*] APIs related to the tasks belonging to the stream will throw "InvalidInputException" if the stream of the same name is in the process of being deleted. Once the stream and all of its resources are deleted, CreateProgressUpdateStream for a stream of the same name will succeed, and that stream will be an entirely new logical resource (without any resources associated with the old stream). 44 */45 deleteProgressUpdateStream(callback?: (err: AWSError, data: MigrationHub.Types.DeleteProgressUpdateStreamResult) => void): Request<MigrationHub.Types.DeleteProgressUpdateStreamResult, AWSError>;46 /**47 * Gets the migration status of an application.48 */49 describeApplicationState(params: MigrationHub.Types.DescribeApplicationStateRequest, callback?: (err: AWSError, data: MigrationHub.Types.DescribeApplicationStateResult) => void): Request<MigrationHub.Types.DescribeApplicationStateResult, AWSError>;50 /**51 * Gets the migration status of an application.52 */53 describeApplicationState(callback?: (err: AWSError, data: MigrationHub.Types.DescribeApplicationStateResult) => void): Request<MigrationHub.Types.DescribeApplicationStateResult, AWSError>;54 /**55 * Retrieves a list of all attributes associated with a specific migration task.56 */57 describeMigrationTask(params: MigrationHub.Types.DescribeMigrationTaskRequest, callback?: (err: AWSError, data: MigrationHub.Types.DescribeMigrationTaskResult) => void): Request<MigrationHub.Types.DescribeMigrationTaskResult, AWSError>;58 /**59 * Retrieves a list of all attributes associated with a specific migration task.60 */61 describeMigrationTask(callback?: (err: AWSError, data: MigrationHub.Types.DescribeMigrationTaskResult) => void): Request<MigrationHub.Types.DescribeMigrationTaskResult, AWSError>;62 /**63 * Disassociates a created artifact of an AWS resource with a migration task performed by a migration tool that was previously associated. This API has the following traits: A migration user can call the DisassociateCreatedArtifacts operation to disassociate a created AWS Artifact from a migration task. The created artifact name must be provided in ARN (Amazon Resource Name) format which will contain information about type and region; for example: arn:aws:ec2:us-east-1:488216288981:image/ami-6d0ba87b. Examples of the AWS resource behind the created artifact are, AMI's, EC2 instance, or RDS instance, etc. 64 */65 disassociateCreatedArtifact(params: MigrationHub.Types.DisassociateCreatedArtifactRequest, callback?: (err: AWSError, data: MigrationHub.Types.DisassociateCreatedArtifactResult) => void): Request<MigrationHub.Types.DisassociateCreatedArtifactResult, AWSError>;66 /**67 * Disassociates a created artifact of an AWS resource with a migration task performed by a migration tool that was previously associated. This API has the following traits: A migration user can call the DisassociateCreatedArtifacts operation to disassociate a created AWS Artifact from a migration task. The created artifact name must be provided in ARN (Amazon Resource Name) format which will contain information about type and region; for example: arn:aws:ec2:us-east-1:488216288981:image/ami-6d0ba87b. Examples of the AWS resource behind the created artifact are, AMI's, EC2 instance, or RDS instance, etc. 68 */69 disassociateCreatedArtifact(callback?: (err: AWSError, data: MigrationHub.Types.DisassociateCreatedArtifactResult) => void): Request<MigrationHub.Types.DisassociateCreatedArtifactResult, AWSError>;70 /**71 * Disassociate an Application Discovery Service discovered resource from a migration task.72 */73 disassociateDiscoveredResource(params: MigrationHub.Types.DisassociateDiscoveredResourceRequest, callback?: (err: AWSError, data: MigrationHub.Types.DisassociateDiscoveredResourceResult) => void): Request<MigrationHub.Types.DisassociateDiscoveredResourceResult, AWSError>;74 /**75 * Disassociate an Application Discovery Service discovered resource from a migration task.76 */77 disassociateDiscoveredResource(callback?: (err: AWSError, data: MigrationHub.Types.DisassociateDiscoveredResourceResult) => void): Request<MigrationHub.Types.DisassociateDiscoveredResourceResult, AWSError>;78 /**79 * Registers a new migration task which represents a server, database, etc., being migrated to AWS by a migration tool. This API is a prerequisite to calling the NotifyMigrationTaskState API as the migration tool must first register the migration task with Migration Hub.80 */81 importMigrationTask(params: MigrationHub.Types.ImportMigrationTaskRequest, callback?: (err: AWSError, data: MigrationHub.Types.ImportMigrationTaskResult) => void): Request<MigrationHub.Types.ImportMigrationTaskResult, AWSError>;82 /**83 * Registers a new migration task which represents a server, database, etc., being migrated to AWS by a migration tool. This API is a prerequisite to calling the NotifyMigrationTaskState API as the migration tool must first register the migration task with Migration Hub.84 */85 importMigrationTask(callback?: (err: AWSError, data: MigrationHub.Types.ImportMigrationTaskResult) => void): Request<MigrationHub.Types.ImportMigrationTaskResult, AWSError>;86 /**87 * Lists all the migration statuses for your applications. If you use the optional ApplicationIds parameter, only the migration statuses for those applications will be returned.88 */89 listApplicationStates(params: MigrationHub.Types.ListApplicationStatesRequest, callback?: (err: AWSError, data: MigrationHub.Types.ListApplicationStatesResult) => void): Request<MigrationHub.Types.ListApplicationStatesResult, AWSError>;90 /**91 * Lists all the migration statuses for your applications. If you use the optional ApplicationIds parameter, only the migration statuses for those applications will be returned.92 */93 listApplicationStates(callback?: (err: AWSError, data: MigrationHub.Types.ListApplicationStatesResult) => void): Request<MigrationHub.Types.ListApplicationStatesResult, AWSError>;94 /**95 * Lists the created artifacts attached to a given migration task in an update stream. This API has the following traits: Gets the list of the created artifacts while migration is taking place. Shows the artifacts created by the migration tool that was associated by the AssociateCreatedArtifact API. Lists created artifacts in a paginated interface. 96 */97 listCreatedArtifacts(params: MigrationHub.Types.ListCreatedArtifactsRequest, callback?: (err: AWSError, data: MigrationHub.Types.ListCreatedArtifactsResult) => void): Request<MigrationHub.Types.ListCreatedArtifactsResult, AWSError>;98 /**99 * Lists the created artifacts attached to a given migration task in an update stream. This API has the following traits: Gets the list of the created artifacts while migration is taking place. Shows the artifacts created by the migration tool that was associated by the AssociateCreatedArtifact API. Lists created artifacts in a paginated interface. 100 */101 listCreatedArtifacts(callback?: (err: AWSError, data: MigrationHub.Types.ListCreatedArtifactsResult) => void): Request<MigrationHub.Types.ListCreatedArtifactsResult, AWSError>;102 /**103 * Lists discovered resources associated with the given MigrationTask.104 */105 listDiscoveredResources(params: MigrationHub.Types.ListDiscoveredResourcesRequest, callback?: (err: AWSError, data: MigrationHub.Types.ListDiscoveredResourcesResult) => void): Request<MigrationHub.Types.ListDiscoveredResourcesResult, AWSError>;106 /**107 * Lists discovered resources associated with the given MigrationTask.108 */109 listDiscoveredResources(callback?: (err: AWSError, data: MigrationHub.Types.ListDiscoveredResourcesResult) => void): Request<MigrationHub.Types.ListDiscoveredResourcesResult, AWSError>;110 /**111 * Lists all, or filtered by resource name, migration tasks associated with the user account making this call. This API has the following traits: Can show a summary list of the most recent migration tasks. Can show a summary list of migration tasks associated with a given discovered resource. Lists migration tasks in a paginated interface. 112 */113 listMigrationTasks(params: MigrationHub.Types.ListMigrationTasksRequest, callback?: (err: AWSError, data: MigrationHub.Types.ListMigrationTasksResult) => void): Request<MigrationHub.Types.ListMigrationTasksResult, AWSError>;114 /**115 * Lists all, or filtered by resource name, migration tasks associated with the user account making this call. This API has the following traits: Can show a summary list of the most recent migration tasks. Can show a summary list of migration tasks associated with a given discovered resource. Lists migration tasks in a paginated interface. 116 */117 listMigrationTasks(callback?: (err: AWSError, data: MigrationHub.Types.ListMigrationTasksResult) => void): Request<MigrationHub.Types.ListMigrationTasksResult, AWSError>;118 /**119 * Lists progress update streams associated with the user account making this call.120 */121 listProgressUpdateStreams(params: MigrationHub.Types.ListProgressUpdateStreamsRequest, callback?: (err: AWSError, data: MigrationHub.Types.ListProgressUpdateStreamsResult) => void): Request<MigrationHub.Types.ListProgressUpdateStreamsResult, AWSError>;122 /**123 * Lists progress update streams associated with the user account making this call.124 */125 listProgressUpdateStreams(callback?: (err: AWSError, data: MigrationHub.Types.ListProgressUpdateStreamsResult) => void): Request<MigrationHub.Types.ListProgressUpdateStreamsResult, AWSError>;126 /**127 * Sets the migration state of an application. For a given application identified by the value passed to ApplicationId, its status is set or updated by passing one of three values to Status: NOT_STARTED | IN_PROGRESS | COMPLETED.128 */129 notifyApplicationState(params: MigrationHub.Types.NotifyApplicationStateRequest, callback?: (err: AWSError, data: MigrationHub.Types.NotifyApplicationStateResult) => void): Request<MigrationHub.Types.NotifyApplicationStateResult, AWSError>;130 /**131 * Sets the migration state of an application. For a given application identified by the value passed to ApplicationId, its status is set or updated by passing one of three values to Status: NOT_STARTED | IN_PROGRESS | COMPLETED.132 */133 notifyApplicationState(callback?: (err: AWSError, data: MigrationHub.Types.NotifyApplicationStateResult) => void): Request<MigrationHub.Types.NotifyApplicationStateResult, AWSError>;134 /**135 * Notifies Migration Hub of the current status, progress, or other detail regarding a migration task. This API has the following traits: Migration tools will call the NotifyMigrationTaskState API to share the latest progress and status. MigrationTaskName is used for addressing updates to the correct target. ProgressUpdateStream is used for access control and to provide a namespace for each migration tool. 136 */137 notifyMigrationTaskState(params: MigrationHub.Types.NotifyMigrationTaskStateRequest, callback?: (err: AWSError, data: MigrationHub.Types.NotifyMigrationTaskStateResult) => void): Request<MigrationHub.Types.NotifyMigrationTaskStateResult, AWSError>;138 /**139 * Notifies Migration Hub of the current status, progress, or other detail regarding a migration task. This API has the following traits: Migration tools will call the NotifyMigrationTaskState API to share the latest progress and status. MigrationTaskName is used for addressing updates to the correct target. ProgressUpdateStream is used for access control and to provide a namespace for each migration tool. 140 */141 notifyMigrationTaskState(callback?: (err: AWSError, data: MigrationHub.Types.NotifyMigrationTaskStateResult) => void): Request<MigrationHub.Types.NotifyMigrationTaskStateResult, AWSError>;142 /**143 * Provides identifying details of the resource being migrated so that it can be associated in the Application Discovery Service repository. This association occurs asynchronously after PutResourceAttributes returns. Keep in mind that subsequent calls to PutResourceAttributes will override previously stored attributes. For example, if it is first called with a MAC address, but later, it is desired to add an IP address, it will then be required to call it with both the IP and MAC addresses to prevent overriding the MAC address. Note the instructions regarding the special use case of the ResourceAttributeList parameter when specifying any "VM" related value. Because this is an asynchronous call, it will always return 200, whether an association occurs or not. To confirm if an association was found based on the provided details, call ListDiscoveredResources. 144 */145 putResourceAttributes(params: MigrationHub.Types.PutResourceAttributesRequest, callback?: (err: AWSError, data: MigrationHub.Types.PutResourceAttributesResult) => void): Request<MigrationHub.Types.PutResourceAttributesResult, AWSError>;146 /**147 * Provides identifying details of the resource being migrated so that it can be associated in the Application Discovery Service repository. This association occurs asynchronously after PutResourceAttributes returns. Keep in mind that subsequent calls to PutResourceAttributes will override previously stored attributes. For example, if it is first called with a MAC address, but later, it is desired to add an IP address, it will then be required to call it with both the IP and MAC addresses to prevent overriding the MAC address. Note the instructions regarding the special use case of the ResourceAttributeList parameter when specifying any "VM" related value. Because this is an asynchronous call, it will always return 200, whether an association occurs or not. To confirm if an association was found based on the provided details, call ListDiscoveredResources. 148 */149 putResourceAttributes(callback?: (err: AWSError, data: MigrationHub.Types.PutResourceAttributesResult) => void): Request<MigrationHub.Types.PutResourceAttributesResult, AWSError>;150}151declare namespace MigrationHub {152 export type ApplicationId = string;153 export type ApplicationIds = ApplicationId[];154 export interface ApplicationState {155 /**156 * The configurationId from the Application Discovery Service that uniquely identifies an application.157 */158 ApplicationId?: ApplicationId;159 /**160 * The current status of an application.161 */162 ApplicationStatus?: ApplicationStatus;163 /**164 * The timestamp when the application status was last updated.165 */166 LastUpdatedTime?: UpdateDateTime;167 }168 export type ApplicationStateList = ApplicationState[];169 export type ApplicationStatus = "NOT_STARTED"|"IN_PROGRESS"|"COMPLETED"|string;170 export interface AssociateCreatedArtifactRequest {171 /**172 * The name of the ProgressUpdateStream. 173 */174 ProgressUpdateStream: ProgressUpdateStream;175 /**176 * Unique identifier that references the migration task. Do not store personal data in this field. 177 */178 MigrationTaskName: MigrationTaskName;179 /**180 * An ARN of the AWS resource related to the migration (e.g., AMI, EC2 instance, RDS instance, etc.) 181 */182 CreatedArtifact: CreatedArtifact;183 /**184 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.185 */186 DryRun?: DryRun;187 }188 export interface AssociateCreatedArtifactResult {189 }190 export interface AssociateDiscoveredResourceRequest {191 /**192 * The name of the ProgressUpdateStream.193 */194 ProgressUpdateStream: ProgressUpdateStream;195 /**196 * The identifier given to the MigrationTask. Do not store personal data in this field. 197 */198 MigrationTaskName: MigrationTaskName;199 /**200 * Object representing a Resource.201 */202 DiscoveredResource: DiscoveredResource;203 /**204 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.205 */206 DryRun?: DryRun;207 }208 export interface AssociateDiscoveredResourceResult {209 }210 export type ConfigurationId = string;211 export interface CreateProgressUpdateStreamRequest {212 /**213 * The name of the ProgressUpdateStream. Do not store personal data in this field. 214 */215 ProgressUpdateStreamName: ProgressUpdateStream;216 /**217 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.218 */219 DryRun?: DryRun;220 }221 export interface CreateProgressUpdateStreamResult {222 }223 export interface CreatedArtifact {224 /**225 * An ARN that uniquely identifies the result of a migration task.226 */227 Name: CreatedArtifactName;228 /**229 * A description that can be free-form text to record additional detail about the artifact for clarity or for later reference.230 */231 Description?: CreatedArtifactDescription;232 }233 export type CreatedArtifactDescription = string;234 export type CreatedArtifactList = CreatedArtifact[];235 export type CreatedArtifactName = string;236 export interface DeleteProgressUpdateStreamRequest {237 /**238 * The name of the ProgressUpdateStream. Do not store personal data in this field. 239 */240 ProgressUpdateStreamName: ProgressUpdateStream;241 /**242 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.243 */244 DryRun?: DryRun;245 }246 export interface DeleteProgressUpdateStreamResult {247 }248 export interface DescribeApplicationStateRequest {249 /**250 * The configurationId in Application Discovery Service that uniquely identifies the grouped application.251 */252 ApplicationId: ApplicationId;253 }254 export interface DescribeApplicationStateResult {255 /**256 * Status of the application - Not Started, In-Progress, Complete.257 */258 ApplicationStatus?: ApplicationStatus;259 /**260 * The timestamp when the application status was last updated.261 */262 LastUpdatedTime?: UpdateDateTime;263 }264 export interface DescribeMigrationTaskRequest {265 /**266 * The name of the ProgressUpdateStream. 267 */268 ProgressUpdateStream: ProgressUpdateStream;269 /**270 * The identifier given to the MigrationTask. Do not store personal data in this field. 271 */272 MigrationTaskName: MigrationTaskName;273 }274 export interface DescribeMigrationTaskResult {275 /**276 * Object encapsulating information about the migration task.277 */278 MigrationTask?: MigrationTask;279 }280 export interface DisassociateCreatedArtifactRequest {281 /**282 * The name of the ProgressUpdateStream. 283 */284 ProgressUpdateStream: ProgressUpdateStream;285 /**286 * Unique identifier that references the migration task to be disassociated with the artifact. Do not store personal data in this field. 287 */288 MigrationTaskName: MigrationTaskName;289 /**290 * An ARN of the AWS resource related to the migration (e.g., AMI, EC2 instance, RDS instance, etc.)291 */292 CreatedArtifactName: CreatedArtifactName;293 /**294 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.295 */296 DryRun?: DryRun;297 }298 export interface DisassociateCreatedArtifactResult {299 }300 export interface DisassociateDiscoveredResourceRequest {301 /**302 * The name of the ProgressUpdateStream.303 */304 ProgressUpdateStream: ProgressUpdateStream;305 /**306 * The identifier given to the MigrationTask. Do not store personal data in this field. 307 */308 MigrationTaskName: MigrationTaskName;309 /**310 * ConfigurationId of the Application Discovery Service resource to be disassociated.311 */312 ConfigurationId: ConfigurationId;313 /**314 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.315 */316 DryRun?: DryRun;317 }318 export interface DisassociateDiscoveredResourceResult {319 }320 export interface DiscoveredResource {321 /**322 * The configurationId in Application Discovery Service that uniquely identifies the on-premise resource.323 */324 ConfigurationId: ConfigurationId;325 /**326 * A description that can be free-form text to record additional detail about the discovered resource for clarity or later reference.327 */328 Description?: DiscoveredResourceDescription;329 }330 export type DiscoveredResourceDescription = string;331 export type DiscoveredResourceList = DiscoveredResource[];332 export type DryRun = boolean;333 export interface ImportMigrationTaskRequest {334 /**335 * The name of the ProgressUpdateStream. >336 */337 ProgressUpdateStream: ProgressUpdateStream;338 /**339 * Unique identifier that references the migration task. Do not store personal data in this field. 340 */341 MigrationTaskName: MigrationTaskName;342 /**343 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.344 */345 DryRun?: DryRun;346 }347 export interface ImportMigrationTaskResult {348 }349 export type LatestResourceAttributeList = ResourceAttribute[];350 export interface ListApplicationStatesRequest {351 /**352 * The configurationIds from the Application Discovery Service that uniquely identifies your applications.353 */354 ApplicationIds?: ApplicationIds;355 /**356 * If a NextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in NextToken.357 */358 NextToken?: Token;359 /**360 * Maximum number of results to be returned per page.361 */362 MaxResults?: MaxResults;363 }364 export interface ListApplicationStatesResult {365 /**366 * A list of Applications that exist in Application Discovery Service.367 */368 ApplicationStateList?: ApplicationStateList;369 /**370 * If a NextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in NextToken.371 */372 NextToken?: Token;373 }374 export interface ListCreatedArtifactsRequest {375 /**376 * The name of the ProgressUpdateStream. 377 */378 ProgressUpdateStream: ProgressUpdateStream;379 /**380 * Unique identifier that references the migration task. Do not store personal data in this field. 381 */382 MigrationTaskName: MigrationTaskName;383 /**384 * If a NextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in NextToken.385 */386 NextToken?: Token;387 /**388 * Maximum number of results to be returned per page.389 */390 MaxResults?: MaxResultsCreatedArtifacts;391 }392 export interface ListCreatedArtifactsResult {393 /**394 * If there are more created artifacts than the max result, return the next token to be passed to the next call as a bookmark of where to start from.395 */396 NextToken?: Token;397 /**398 * List of created artifacts up to the maximum number of results specified in the request.399 */400 CreatedArtifactList?: CreatedArtifactList;401 }402 export interface ListDiscoveredResourcesRequest {403 /**404 * The name of the ProgressUpdateStream.405 */406 ProgressUpdateStream: ProgressUpdateStream;407 /**408 * The name of the MigrationTask. Do not store personal data in this field. 409 */410 MigrationTaskName: MigrationTaskName;411 /**412 * If a NextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in NextToken.413 */414 NextToken?: Token;415 /**416 * The maximum number of results returned per page.417 */418 MaxResults?: MaxResultsResources;419 }420 export interface ListDiscoveredResourcesResult {421 /**422 * If there are more discovered resources than the max result, return the next token to be passed to the next call as a bookmark of where to start from.423 */424 NextToken?: Token;425 /**426 * Returned list of discovered resources associated with the given MigrationTask.427 */428 DiscoveredResourceList?: DiscoveredResourceList;429 }430 export interface ListMigrationTasksRequest {431 /**432 * If a NextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in NextToken.433 */434 NextToken?: Token;435 /**436 * Value to specify how many results are returned per page.437 */438 MaxResults?: MaxResults;439 /**440 * Filter migration tasks by discovered resource name.441 */442 ResourceName?: ResourceName;443 }444 export interface ListMigrationTasksResult {445 /**446 * If there are more migration tasks than the max result, return the next token to be passed to the next call as a bookmark of where to start from.447 */448 NextToken?: Token;449 /**450 * Lists the migration task's summary which includes: MigrationTaskName, ProgressPercent, ProgressUpdateStream, Status, and the UpdateDateTime for each task.451 */452 MigrationTaskSummaryList?: MigrationTaskSummaryList;453 }454 export interface ListProgressUpdateStreamsRequest {455 /**456 * If a NextToken was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in NextToken.457 */458 NextToken?: Token;459 /**460 * Filter to limit the maximum number of results to list per page.461 */462 MaxResults?: MaxResults;463 }464 export interface ListProgressUpdateStreamsResult {465 /**466 * List of progress update streams up to the max number of results passed in the input.467 */468 ProgressUpdateStreamSummaryList?: ProgressUpdateStreamSummaryList;469 /**470 * If there are more streams created than the max result, return the next token to be passed to the next call as a bookmark of where to start from.471 */472 NextToken?: Token;473 }474 export type MaxResults = number;475 export type MaxResultsCreatedArtifacts = number;476 export type MaxResultsResources = number;477 export interface MigrationTask {478 /**479 * A name that identifies the vendor of the migration tool being used.480 */481 ProgressUpdateStream?: ProgressUpdateStream;482 /**483 * Unique identifier that references the migration task. Do not store personal data in this field. 484 */485 MigrationTaskName?: MigrationTaskName;486 /**487 * Task object encapsulating task information.488 */489 Task?: Task;490 /**491 * The timestamp when the task was gathered.492 */493 UpdateDateTime?: UpdateDateTime;494 /**495 * Information about the resource that is being migrated. This data will be used to map the task to a resource in the Application Discovery Service repository.496 */497 ResourceAttributeList?: LatestResourceAttributeList;498 }499 export type MigrationTaskName = string;500 export interface MigrationTaskSummary {501 /**502 * An AWS resource used for access control. It should uniquely identify the migration tool as it is used for all updates made by the tool.503 */504 ProgressUpdateStream?: ProgressUpdateStream;505 /**506 * Unique identifier that references the migration task. Do not store personal data in this field. 507 */508 MigrationTaskName?: MigrationTaskName;509 /**510 * Status of the task.511 */512 Status?: Status;513 /**514 * Indication of the percentage completion of the task.515 */516 ProgressPercent?: ProgressPercent;517 /**518 * Detail information of what is being done within the overall status state.519 */520 StatusDetail?: StatusDetail;521 /**522 * The timestamp when the task was gathered.523 */524 UpdateDateTime?: UpdateDateTime;525 }526 export type MigrationTaskSummaryList = MigrationTaskSummary[];527 export type NextUpdateSeconds = number;528 export interface NotifyApplicationStateRequest {529 /**530 * The configurationId in Application Discovery Service that uniquely identifies the grouped application.531 */532 ApplicationId: ApplicationId;533 /**534 * Status of the application - Not Started, In-Progress, Complete.535 */536 Status: ApplicationStatus;537 /**538 * The timestamp when the application state changed.539 */540 UpdateDateTime?: UpdateDateTime;541 /**542 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.543 */544 DryRun?: DryRun;545 }546 export interface NotifyApplicationStateResult {547 }548 export interface NotifyMigrationTaskStateRequest {549 /**550 * The name of the ProgressUpdateStream. 551 */552 ProgressUpdateStream: ProgressUpdateStream;553 /**554 * Unique identifier that references the migration task. Do not store personal data in this field. 555 */556 MigrationTaskName: MigrationTaskName;557 /**558 * Information about the task's progress and status.559 */560 Task: Task;561 /**562 * The timestamp when the task was gathered.563 */564 UpdateDateTime: UpdateDateTime;565 /**566 * Number of seconds after the UpdateDateTime within which the Migration Hub can expect an update. If Migration Hub does not receive an update within the specified interval, then the migration task will be considered stale.567 */568 NextUpdateSeconds: NextUpdateSeconds;569 /**570 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.571 */572 DryRun?: DryRun;573 }574 export interface NotifyMigrationTaskStateResult {575 }576 export type ProgressPercent = number;577 export type ProgressUpdateStream = string;578 export interface ProgressUpdateStreamSummary {579 /**580 * The name of the ProgressUpdateStream. Do not store personal data in this field. 581 */582 ProgressUpdateStreamName?: ProgressUpdateStream;583 }584 export type ProgressUpdateStreamSummaryList = ProgressUpdateStreamSummary[];585 export interface PutResourceAttributesRequest {586 /**587 * The name of the ProgressUpdateStream. 588 */589 ProgressUpdateStream: ProgressUpdateStream;590 /**591 * Unique identifier that references the migration task. Do not store personal data in this field. 592 */593 MigrationTaskName: MigrationTaskName;594 /**595 * Information about the resource that is being migrated. This data will be used to map the task to a resource in the Application Discovery Service repository. Takes the object array of ResourceAttribute where the Type field is reserved for the following values: IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN | VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID | MOTHERBOARD_SERIAL_NUMBER where the identifying value can be a string up to 256 characters. If any "VM" related value is set for a ResourceAttribute object, it is required that VM_MANAGER_ID, as a minimum, is always set. If VM_MANAGER_ID is not set, then all "VM" fields will be discarded and "VM" fields will not be used for matching the migration task to a server in Application Discovery Service repository. See the Example section below for a use case of specifying "VM" related values. If a server you are trying to match has multiple IP or MAC addresses, you should provide as many as you know in separate type/value pairs passed to the ResourceAttributeList parameter to maximize the chances of matching. 596 */597 ResourceAttributeList: ResourceAttributeList;598 /**599 * Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.600 */601 DryRun?: DryRun;602 }603 export interface PutResourceAttributesResult {604 }605 export interface ResourceAttribute {606 /**607 * Type of resource.608 */609 Type: ResourceAttributeType;610 /**611 * Value of the resource type.612 */613 Value: ResourceAttributeValue;614 }615 export type ResourceAttributeList = ResourceAttribute[];616 export type ResourceAttributeType = "IPV4_ADDRESS"|"IPV6_ADDRESS"|"MAC_ADDRESS"|"FQDN"|"VM_MANAGER_ID"|"VM_MANAGED_OBJECT_REFERENCE"|"VM_NAME"|"VM_PATH"|"BIOS_ID"|"MOTHERBOARD_SERIAL_NUMBER"|string;617 export type ResourceAttributeValue = string;618 export type ResourceName = string;619 export type Status = "NOT_STARTED"|"IN_PROGRESS"|"FAILED"|"COMPLETED"|string;620 export type StatusDetail = string;621 export interface Task {622 /**623 * Status of the task - Not Started, In-Progress, Complete.624 */625 Status: Status;626 /**627 * Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.628 */629 StatusDetail?: StatusDetail;630 /**631 * Indication of the percentage completion of the task.632 */633 ProgressPercent?: ProgressPercent;634 }635 export type Token = string;636 export type UpdateDateTime = Date;637 /**638 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.639 */640 export type apiVersion = "2017-05-31"|"latest"|string;641 export interface ClientApiVersions {642 /**643 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.644 */645 apiVersion?: apiVersion;646 }647 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;648 /**649 * Contains interfaces for use with the MigrationHub client.650 */651 export import Types = MigrationHub;652}...
migrate.js
Source:migrate.js
1'use strict';2const fs = require('fs');3const path = require('path');4const commandLineArgs = require('command-line-args');5const AWS = require('aws-sdk');6const Promise = require('bluebird');7const question = require('cli-interact').getYesNo;8const config = require('../defaults.json');9const createTables = require('./table/create');10const createItems = require('./item/create');11const optionDefinitions = [12 { name: 'force', alias: 'f', type: Boolean },13];14const options = commandLineArgs(optionDefinitions);15const dynamoConfig = {};16if (process.env.DYNAMO_ENDPOINT) {17 dynamoConfig.endpoint = process.env.DYNAMO_ENDPOINT;18}19const dynamo = new AWS.DynamoDB(dynamoConfig);20const dynamoDoc = new AWS.DynamoDB.DocumentClient(dynamoConfig);21const migrationDir = process.env.MIGRATION_DIR || config.MIGRATION_DIR;22const migrationPath = path.join(process.cwd(), migrationDir);23const migrationTableName = process.env.MIGRATION_TABLE || config.DEFAULT_MIGRATION_TABLE_CONFIG.tableName;24const migrationAttribute = process.env.MIGRATION_ATTRIBUTE || config.DEFAULT_MIGRATION_TABLE_CONFIG.attributeName;25const checkMigrationTable = () => {26 return dynamo.describeTable({27 TableName: migrationTableName,28 }).promise()29 .catch((err) => {30 if (err.code === 'ResourceNotFoundException') {31 return dynamo.createTable({32 TableName: migrationTableName,33 ProvisionedThroughput: {34 ReadCapacityUnits: 1,35 WriteCapacityUnits: 1,36 },37 AttributeDefinitions: [38 {39 AttributeName: migrationAttribute,40 AttributeType: 'S',41 },42 ],43 KeySchema: [44 {45 AttributeName: config.DEFAULT_MIGRATION_TABLE_CONFIG.attributeName,46 KeyType: 'HASH',47 },48 ],49 }).promise();50 }51 return Promise.reject(err);52 });53};54const getMigrationData = (migration) => {55 return migration[migrationAttribute];56};57const scanAll = (lastKey) => {58 return dynamoDoc.scan({59 TableName: migrationTableName,60 ExclusiveStartKey: lastKey,61 Limit: 1,62 }).promise()63 .then((data) => {64 const items = data.Items.map(getMigrationData);65 if (data.LastEvaluatedKey) {66 return scanAll(data.LastEvaluatedKey)67 .then((recursiveItems) => {68 return items.concat(recursiveItems);69 });70 }71 return items;72 });73};74const getMigrationsDone = () => {75 return scanAll();76};77const runMigration = (migration) => {78 const toRun = [];79 if (migration.table) {80 if (migration.table.create) {81 toRun.push(createTables(migration.table.create));82 }83 if (migration.table.delete) {84 // TODO85 }86 if (migration.table.update) {87 // TODO88 }89 }90 if (migration.item) {91 if (migration.item.create) {92 toRun.push(createItems(migration.item.create));93 }94 if (migration.item.delete) {95 // TODO96 }97 if (migration.item.update) {98 // TODO99 }100 }101 const promises = toRun.map((data) => {102 switch (data.type) {103 case 'dynamo':104 return Promise.all(data.paramsBatch.map((params) => {105 return dynamo[data.action](params).promise();106 }));107 case 'dynamoDoc':108 return Promise.all(data.paramsBatch.map((params) => {109 return dynamoDoc[data.action](params).promise();110 }));111 default:112 return false;113 }114 });115 return Promise.all(promises);116};117const runMigrations = (migrationsDone) => {118 if (!fs.existsSync(migrationPath)) {119 fs.mkdirSync(migrationPath);120 }121 const migrationFiles = fs.readdirSync(migrationPath);122 const migrations = migrationFiles123 .filter((file) => {124 const migration = file.replace('.json', '');125 return migrationsDone.indexOf(migration) === -1;126 });127 if (!migrations.length) {128 console.log('Everything up to date');129 return true;130 }131 if (!options.force) {132 console.log(`Found ${migrations.length} missing migrations:`);133 console.log(`\t${migrations.join('\n\t')}`);134 const answer = question('Run migrations');135 if (!answer) {136 console.log('Migration process canceled by the user');137 return false;138 }139 } else {140 console.log('Migration process run with force flag. Skipping user confirmation');141 }142 return migrations143 .reduce((previousMigration, file) => {144 const migration = file.replace('.json', '');145 const fileContent = fs.readFileSync(path.join(migrationPath, file), 'utf-8');146 const migrationObj = JSON.parse(fileContent);147 return previousMigration148 .then(() => {149 return runMigration(migrationObj);150 })151 .then(() => {152 return dynamoDoc.put({153 TableName: migrationTableName,154 Item: {155 [migrationAttribute]: migration,156 },157 }).promise();158 })159 .then(() => {160 console.log(`Migration ${migration} success`);161 })162 .catch((err) => {163 console.log(`Migration ${migration} failed`);164 return Promise.reject(err);165 });166 }, Promise.resolve());167};168module.exports = () => {169 checkMigrationTable()170 .then(getMigrationsDone)171 .then(runMigrations)172 .then(() => {173 console.log('Migrations run');174 })175 .catch((err) => {176 console.log('Error while running migration', err.stack);177 });...
Using AI Code Generation
1var db = require('./db');2 if (err) {3 console.log('Unable to connect to Mongo.');4 process.exit(1);5 } else {6 db.get().collection('users').find().toArray(function(err, docs) {7 if (err) {8 console.log(err);9 process.exit(1);10 } else {11 console.log('Found:', docs);12 }13 });14 }15});16var MongoClient = require('mongodb').MongoClient;17var state = {18};19exports.connect = function(url, done) {20 if (state.db) return done();21 MongoClient.connect(url, function(err, db) {22 if (err) return done(err);23 state.db = db;24 done();25 });26};27exports.get = function() {28 return state.db;29};30exports.close = function(done) {31 if (state.db) {32 state.db.close(function(err, result) {33 state.db = null;34 state.mode = null;35 done(err);36 });37 }38};39var db = require('./db');40 if (err) {41 console.log('Unable to connect to Mongo.');42 process.exit(1);43 } else {44 db.get().collection('users').find().toArray(function(err, docs) {45 if (err) {46 console.log(err);47 process.exit(1);48 } else {49 console.log('Found:', docs);50 }51 });52 }53});54var MongoClient = require('mongodb').MongoClient;55var state = {56};57exports.connect = function(url, done) {58 if (state.db) return done();59 MongoClient.connect(url, function(err, db) {60 if (err) return done(err);61 state.db = db;62 done();63 });64};65exports.get = function() {66 return state.db;67};68exports.close = function(done) {69 if (state.db) {70 state.db.close(function
Using AI Code Generation
1var migration = require('./migration').migration;2migration.migrate();3exports.migration = {4 migrate: function () {5 console.log('Migration method of Best Practices');6 }7};8var migration = require('./migration');9migration.migrate();10module.exports = {11 migrate: function () {12 console.log('Migration method of Best Practices');13 }14};15var migration = require('./migration');16migration.migrate();17exports = {18 migrate: function () {19 console.log('Migration method of Best Practices');20 }21};22var migration = require('./migration');23migration.migrate();24exports.migrate = function () {25 console.log('Migration method of Best Practices');26};27var migration = require('./migration');28migration.migrate();29var exports = {30 migrate: function () {31 console.log('Migration method of Best Practices');32 }33};34var migration = require('./migration');35migration.migrate();36module.exports.migrate = function () {37 console.log('Migration method of Best Practices');38};39var migration = require('./migration');40migration.migrate();41var exports = {};42exports.migrate = function () {43 console.log('Migration method of Best Practices');44};45var migration = require('./migration');46migration.migrate();47var exports = function () {
Using AI Code Generation
1var mongoose = require('mongoose');2var Schema = mongoose.Schema;3var ObjectId = Schema.ObjectId;4var UserSchema = new Schema({5});6var User = db.model('User', UserSchema);7var user = new User({8 date: new Date()9});10user.save(function(error, user) {11 if (error) {12 console.log(error);13 } else {14 console.log('saved OK!');15 }16});17var mongoose = require('mongoose');18var Schema = mongoose.Schema;19var ObjectId = Schema.ObjectId;20var UserSchema = new Schema({21});22var User = db.model('User', UserSchema);23var user = new User({24 date: new Date()25});26user.save(function(error, user) {27 if (error) {28 console.log(error);29 } else {30 console.log('saved OK!');31 }32});33var mongoose = require('mongoose');34var Schema = mongoose.Schema;35var ObjectId = Schema.ObjectId;36var UserSchema = new Schema({37});38var User = db.model('User', UserSchema);39var user = new User({40 date: new Date()41});42user.save(function(error, user) {43 if (error) {44 console.log(error);45 } else {46 console.log('saved OK!');47 }48});49var mongoose = require('mongoose');
Using AI Code Generation
1const {migration} = require("../../../utils/deprecated");2module.exports = migration({3 runOnce: client => {4 console.log("This is a migration");5 },6 init: async client => {7 console.log("This is a migration");8 },9 updateConfig: async client => {10 console.log("This is a migration");11 }12});13module.exports = {14 runOnce: client => {15 console.log("This is a migration");16 },17 init: async client => {18 console.log("This is a migration");19 },20 updateConfig: async client => {21 console.log("This is a migration");22 }23};24module.exports = {25 runOnce: client => {26 console.log("This is a migration");27 },28 init: async client => {29 console.log("This is a migration");30 },31 updateConfig: async client => {32 console.log("This is a migration");33 }34};35module.exports = {36 runOnce: client => {37 console.log("This is a migration");38 },39 init: async client => {40 console.log("This is a migration");41 },42 updateConfig: async client => {43 console.log("This is a migration");44 },45 events: {46 message: message => {47 console.log("This is an event");48 }49 }
Using AI Code Generation
1var mongo = require('mongodb');2var client = new mongo.MongoClient(new mongo.Server("localhost", 27017));3client.open(function(err, client) {4 var db = client.db("test");5 var collection = db.collection("test_insert");6 collection.insert({a:2}, function(err, docs) {7 collection.count(function(err, count) {8 console.log(format("count = %s", count));9 });10 collection.find().toArray(function(err, results) {11 console.dir(results);12 client.close();13 });14 });15});16var mongo = require('mongodb');17var client = new mongo.MongoClient(new mongo.Server("localhost", 27017));18client.open(function(err, client) {19 var db = client.db("test");20 var collection = db.collection("test_insert");21 collection.insert({a:2}, function(err, docs) {22 collection.count(function(err, count) {23 console.log(format("count = %s", count));24 });25 collection.find().toArray(function(err, results) {26 console.dir(results);27 client.close();28 });29 });30});31var mongo = require('mongodb');32var client = new mongo.MongoClient(new mongo.Server("localhost", 27017));33client.open(function(err, client) {34 var db = client.db("test");35 var collection = db.collection("test_insert");36 collection.insert({a:2}, function(err, docs) {
Using AI Code Generation
1var db = require('./db');2var migration = require('./migration');3var test4 = function() {4 var data = {5 "scripts": {6 },7 "dependencies": {8 }9 }10 db.query('INSERT INTO test SET ?', data, function(err, result) {11 if (err) {12 console.log(err);13 } else {14 migration();15 console.log("test4.js: " + result);16 }17 });18}19module.exports = test4;
Using AI Code Generation
1exports.up = function(knex, Promise) {2 return knex.schema.createTable('users', function(table) {3 table.increments();4 table.string('username').notNullable();5 table.string('password').notNullable();6 });7};8exports.down = function(knex, Promise) {9 return knex.schema.dropTable('users');10};11exports.up = function(knex, Promise) {12 return knex.schema.createTable('users', function(table) {13 table.increments();14 table.string('username').notNullable();15 table.string('password').notNullable();16 });17};18exports.down = function(knex, Promise) {19 return knex.schema.dropTable('users');20};21exports.up = function(knex, Promise) {22 return knex.schema.createTable('users', function(table) {23 table.increments();24 table.string('username').notNullable();25 table.string('password').notNullable();26 });27};28exports.down = function(knex, Promise) {29 return knex.schema.dropTable('users');30};31exports.up = function(knex, Promise) {32 return knex.schema.createTable('users', function(table) {33 table.increments();34 table.string('username').notNullable();35 table.string('password').notNullable();36 });37};38exports.down = function(knex, Promise) {39 return knex.schema.dropTable('users');40};
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!