_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c168600
validation
// InstanceIdentityDocument mocks base method
{ "resource": "" }
c168601
validation
// NewMockHttpClient creates a new mock instance
{ "resource": "" }
c168602
validation
// GetInstanceIdentityDocument mocks base method
{ "resource": "" }
c168603
validation
// GetUserData mocks base method
{ "resource": "" }
c168604
validation
// GetUserData indicates an expected call of GetUserData
{ "resource": "" }
c168605
validation
// NewMockClient creates a new mock instance
{ "resource": "" }
c168606
validation
// DescribeECSTagsForInstance mocks base method
{ "resource": "" }
c168607
validation
// NewMockClientSDK creates a new mock instance
{ "resource": "" }
c168608
validation
// CreateTags mocks base method
{ "resource": "" }
c168609
validation
// DescribeTags mocks base method
{ "resource": "" }
c168610
validation
// DescribeTags indicates an expected call of DescribeTags
{ "resource": "" }
c168611
validation
// NewStateManager constructs a new StateManager which saves data at the // location specified in cfg and operates under the given options. // The returned StateManager will not save more often than every 10 seconds and // will not reliably return errors with Save, but will log them appropriately.
{ "resource": "" }
c168612
validation
// Save triggers a save to file, though respects a minimum save interval to wait // between saves.
{ "resource": "" }
c168613
validation
// Load reads state off the disk from the well-known filepath and loads it into // the passed State object.
{ "resource": "" }
c168614
validation
// ValidDependencies takes a task and verifies that it is possible to allow all // containers within it to reach the desired status by proceeding in some // order.
{ "resource": "" }
c168615
validation
// DependenciesCanBeResolved verifies that it's possible to transition a `target` // given a group of already handled containers, `by`. Essentially, it asks "is // `target` resolved by `by`". It assumes that everything in `by` has reached // DesiredStatus and that `target` is also trying to get there // // This functio...
{ "resource": "" }
c168616
validation
// onSteadyStateIsResolved defines a relationship where a target cannot be // created until 'dependency' has reached the steady state. Transitions include pulling.
{ "resource": "" }
c168617
validation
// newAgent returns a new ecsAgent object, but does not start anything
{ "resource": "" }
c168618
validation
// printECSAttributes prints the Agent's ECS Attributes based on its // environment
{ "resource": "" }
c168619
validation
// start starts the ECS Agent
{ "resource": "" }
c168620
validation
// doStart is the worker invoked by start for starting the ECS Agent. This involves // initializing the docker task engine, state saver, image manager, credentials // manager, poll and telemetry sessions, api handler etc
{ "resource": "" }
c168621
validation
// newTaskEngine creates a new docker task engine object. It tries to load the // local state if needed, else initializes a new one
{ "resource": "" }
c168622
validation
// setClusterInConfig sets the cluster name in the config object based on // previous state. It returns an error if there's a mismatch between the // the current cluster name with what's restored from the cluster state
{ "resource": "" }
c168623
validation
// getEC2InstanceID gets the EC2 instance ID from the metadata service
{ "resource": "" }
c168624
validation
// constructVPCSubnetAttributes returns vpc and subnet IDs of the instance as // an attribute list
{ "resource": "" }
c168625
validation
// registerContainerInstance registers the container instance ID for the ECS Agent
{ "resource": "" }
c168626
validation
// reregisterContainerInstance registers a container instance that has already been // registered with ECS. This is for cases where the ECS Agent is being restored // from a check point.
{ "resource": "" }
c168627
validation
// startAsyncRoutines starts all of the background methods
{ "resource": "" }
c168628
validation
// startACSSession starts a session with ECS's Agent Communication service. This // is a blocking call and only returns when the handler returns
{ "resource": "" }
c168629
validation
// getContainerInstanceTagsFromEC2API will retrieve the tags of this instance remotely.
{ "resource": "" }
c168630
validation
// mergeTags will merge the local tags and ec2 tags, for the overlap part, ec2 tags // will be overridden by local tags.
{ "resource": "" }
c168631
validation
// SlicesDeepEqual checks if slice1 and slice2 are equal, disregarding order.
{ "resource": "" }
c168632
validation
// IsAWSErrorCodeEqual returns true if the err implements Error // interface of awserr and it has the same error code as // the passed in error code.
{ "resource": "" }
c168633
validation
// MapToTags converts a map to a slice of tags.
{ "resource": "" }
c168634
validation
// CredentialsHandlerImpl is the major logic in CredentialsHandler, abstract this out // because v2.CredentialsHandler also uses the same logic.
{ "resource": "" }
c168635
validation
// processCredentialsRequest returns the response json containing credentials for the credentials id in the request
{ "resource": "" }
c168636
validation
// NewTaskHandler returns a pointer to TaskHandler
{ "resource": "" }
c168637
validation
// AddStateChangeEvent queues up the state change event to be sent to ECS. // If the event is for a container state change, it just gets added to the // handler.tasksToContainerStates map. // If the event is for task state change, it triggers the non-blocking // handler.submitTaskEvents method to submit the batched con...
{ "resource": "" }
c168638
validation
// startDrainEventsTicker starts a ticker that periodically drains the events queue // by submitting state change events to the ECS backend
{ "resource": "" }
c168639
validation
// taskStateChangesToSend gets a list task state changes for container events that // have been batched and not sent beyond the drainEventsFrequency threshold
{ "resource": "" }
c168640
validation
// batchContainerEventUnsafe collects container state change events for a given task arn
{ "resource": "" }
c168641
validation
// flushBatchUnsafe attaches the task arn's container events to TaskStateChange event // by creating the sendable event list. It then submits this event to ECS asynchronously
{ "resource": "" }
c168642
validation
// getTaskEventsUnsafe gets the event list for the task arn in the sendableEvent // from taskToEvent map
{ "resource": "" }
c168643
validation
// Continuously retries sending an event until it succeeds, sleeping between each // attempt
{ "resource": "" }
c168644
validation
// sendChange adds the change to the sendable events queue. It triggers // the handler's submitTaskEvents async method to submit this change if // there's no go routines already sending changes for this event list
{ "resource": "" }
c168645
validation
// submitFirstEvent submits the first event for the task from the event list. It // returns true if the list became empty after submitting the event. Else, it returns // false. An error is returned if there was an error with submitting the state change // to ECS. The error is used by the backoff handler to backoff befo...
{ "resource": "" }
c168646
validation
// getTasksToEventsLen returns the length of the tasksToEvents map. It is // used only in the test code to ascertain that map has been cleaned up
{ "resource": "" }
c168647
validation
// handleInvalidParamException removes the event from event queue when its parameters are // invalid to reduce redundant API call
{ "resource": "" }
c168648
validation
// NewMockControl creates a new mock instance
{ "resource": "" }
c168649
validation
// Exists mocks base method
{ "resource": "" }
c168650
validation
// Init indicates an expected call of Init
{ "resource": "" }
c168651
validation
// NewQueue creates a queue.
{ "resource": "" }
c168652
validation
// Reset resets the stats queue.
{ "resource": "" }
c168653
validation
// Add adds a new set of container stats to the queue.
{ "resource": "" }
c168654
validation
// GetLastStat returns the last recorded raw statistics object from docker
{ "resource": "" }
c168655
validation
// GetRawUsageStats gets the array of most recent raw UsageStats, in descending // order of timestamps.
{ "resource": "" }
c168656
validation
// getCWStatsSet gets the stats set for either CPU or Memory based on the // function pointer.
{ "resource": "" }
c168657
validation
// NewMockCNIClient creates a new mock instance
{ "resource": "" }
c168658
validation
// Capabilities mocks base method
{ "resource": "" }
c168659
validation
// Capabilities indicates an expected call of Capabilities
{ "resource": "" }
c168660
validation
// CleanupNS mocks base method
{ "resource": "" }
c168661
validation
// ReleaseIPResource mocks base method
{ "resource": "" }
c168662
validation
// SetupNS mocks base method
{ "resource": "" }
c168663
validation
// SetupNS indicates an expected call of SetupNS
{ "resource": "" }
c168664
validation
// ContainerAssociationHandler returns the handler method for handling container associations requests.
{ "resource": "" }
c168665
validation
// ContainerAssociationHandler returns the handler method for handling container association requests.
{ "resource": "" }
c168666
validation
// NewManager creates a metadataManager for a given DockerTaskEngine settings.
{ "resource": "" }
c168667
validation
// Create creates the metadata file and adds the metadata directory to // the container's mounted host volumes // Pointer hostConfig is modified directly so there is risk of concurrency errors.
{ "resource": "" }
c168668
validation
// Update updates the metadata file after container starts and dynamic metadata is available
{ "resource": "" }
c168669
validation
// Clean removes the metadata files of all containers associated with a task
{ "resource": "" }
c168670
validation
// Normalize all auth types into a uniform 'dockerAuths' type. // On error, any appropriate information will be logged and an empty dockerAuths will be returned
{ "resource": "" }
c168671
validation
// ServeHTTP logs the method and remote address of the request.
{ "resource": "" }
c168672
validation
// NewJitteredTicker works like a time.Ticker except with randomly distributed ticks // between start and end duration.
{ "resource": "" }
c168673
validation
// getTaskENIPluginVersionAttribute returns the version information of the ECS // CNI plugins. It just executes the ENI plugin as the assumption is that these // plugins are packaged with the ECS Agent, which means all of the other plugins // should also emit the same version information. Also, the version information ...
{ "resource": "" }
c168674
validation
// NewMockECSSDK creates a new mock instance
{ "resource": "" }
c168675
validation
// CreateCluster mocks base method
{ "resource": "" }
c168676
validation
// ListTagsForResource mocks base method
{ "resource": "" }
c168677
validation
// NewMockECSSubmitStateSDK creates a new mock instance
{ "resource": "" }
c168678
validation
// SubmitContainerStateChange indicates an expected call of SubmitContainerStateChange
{ "resource": "" }
c168679
validation
// NewMockECSClient creates a new mock instance
{ "resource": "" }
c168680
validation
// DiscoverPollEndpoint indicates an expected call of DiscoverPollEndpoint
{ "resource": "" }
c168681
validation
// GetResourceTags mocks base method
{ "resource": "" }
c168682
validation
// NewTaskEngine returns a default TaskEngine
{ "resource": "" }
c168683
validation
// NewMockStateManager creates a new mock instance
{ "resource": "" }
c168684
validation
// NewStateManager mocks base method
{ "resource": "" }
c168685
validation
// NewStateManager indicates an expected call of NewStateManager
{ "resource": "" }
c168686
validation
// NewMockSaveableOption creates a new mock instance
{ "resource": "" }
c168687
validation
// AddSaveable mocks base method
{ "resource": "" }
c168688
validation
// AddSaveable indicates an expected call of AddSaveable
{ "resource": "" }
c168689
validation
// NewECSClient creates a new ECSClient interface object
{ "resource": "" }
c168690
validation
// CreateCluster creates a cluster from a given name and returns its arn
{ "resource": "" }
c168691
validation
// RegisterContainerInstance calculates the appropriate resources, creates // the default cluster if necessary, and returns the registered // ContainerInstanceARN if successful. Supplying a non-empty container // instance ARN allows a container instance to update its registered // resources.
{ "resource": "" }
c168692
validation
// Connect opens a connection to the backend and upgrades it to a websocket. Calls to // 'MakeRequest' can be made after calling this, but responses will not be // receivable until 'Serve' is also called.
{ "resource": "" }
c168693
validation
// IsReady gives a boolean response that informs the caller if the websocket // connection is fully established.
{ "resource": "" }
c168694
validation
// SetReadDeadline sets the read deadline for the websocket connection // A read timeout results in an io error if there are any outstanding reads // that exceed the deadline
{ "resource": "" }
c168695
validation
// Disconnect disconnects the connection
{ "resource": "" }
c168696
validation
// WriteMessage wraps the low level websocket write method with a lock
{ "resource": "" }
c168697
validation
// ConsumeMessages reads messages from the websocket connection and handles read // messages from an active connection.
{ "resource": "" }
c168698
validation
// handleMessage dispatches a message to the correct 'requestHandler' for its // type. If no request handler is found, the message is discarded.
{ "resource": "" }
c168699
validation
// AllTasks returns all of the tasks
{ "resource": "" }