// Attach the given file to a SoftLayer ticket. A file attachment is a convenient way to submit non-textual error reports to SoftLayer employees in a ticket. File attachments to tickets must have a unique name.
555423
func (r Ticket) AddAttachedFile(fileAttachment *datatypes.Container_Utility_File_Attachment) (resp datatypes.Ticket_Attachment_File, err error) {
	params := []interface{}{
		fileAttachment,
	}
	err = r.Session.DoRequest("SoftLayer_Ticket", "addAttachedFile", params, &r.Options, &resp)
	return
}
863954
func (r Ticket) AddAttachedDedicatedHost(dedicatedHostId *int) (resp datatypes.Ticket_Attachment_Dedicated_Host, err error) {
	params := []interface{}{
		dedicatedHostId,
	}
	err = r.Session.DoRequest("SoftLayer_Ticket", "addAttachedDedicatedHost", params, &r.Options, &resp)
	return
}
3616
func (o *PetUploadImageParams) bindFile(file multipart.File, header *multipart.FileHeader) error {
	return nil
}
804013
func (p *Pipeline) Attach(c cue.Collector) cue.Collector {
	if p.prior == nil {
		log.Warn("Pipeline.Attach called on an empty pipeline.")
	}
	return &pipelineCollector{
		pipeline:  p,
		collector: c,
	}
}
944087
func (s *IssueService) DownloadAttachment(attachmentID string) (*Response, error) {
	apiEndpoint := fmt.Sprintf("secure/attachment/%s/", attachmentID)
	req, err := s.client.NewRequest("GET", apiEndpoint, nil)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(req, nil)
	if err != nil {
		jerr := NewJiraError(resp, err)
		return resp, jerr
	}

	return resp, nil
}
1169415
func (m *InjectableEndpoint) Attach(dispatcher stack.NetworkDispatcher) {
	for _, endpoint := range m.routes {
		endpoint.Attach(dispatcher)
	}
	m.dispatcher = dispatcher
}
1144182
func (e *endpoint) Attach(dispatcher stack.NetworkDispatcher) {
	e.dispatcher = dispatcher
	e.lower.Attach(e)
}
86979
func (r Ticket) GetLastViewedDate() (resp datatypes.Time, err error) {
	err = r.Session.DoRequest("SoftLayer_Ticket", "getLastViewedDate", nil, &r.Options, &resp)
	return
}
357312
func (k Kites) Attach(token string) {
	for _, kite := range k {
		kite.Token = token
	}
}
684958
func (m *Scheduler) attach(ctx context.Context, task *ecs.Task, stdin io.Reader, stdout, stderr io.Writer) error {
	if a, _ := arn.Parse(aws.StringValue(task.TaskArn)); a != nil {
		fmt.Fprintf(stderr, "Attaching to %s...\r\n", a.Resource)
	}

	descContainerInstanceResp, err := m.ecs.DescribeContainerInstances(&ecs.DescribeContainerInstancesInput{
		Cluster:            task.ClusterArn,
		ContainerInstances: []*string{task.ContainerInstanceArn},
	})
	if err != nil {
		return fmt.Errorf("error describing container instance (%s): %v", aws.StringValue(task.ContainerInstanceArn), err)
	}

	containerInstance := descContainerInstanceResp.ContainerInstances[0]
	descInstanceResp, err := m.ec2.DescribeInstances(&ec2.DescribeInstancesInput{
		InstanceIds: []*string{containerInstance.Ec2InstanceId},
	})
	if err != nil {
		return fmt.Errorf("error describing ec2 instance (%s): %v", aws.StringValue(containerInstance.Ec2InstanceId), err)
	}

	ec2Instance := descInstanceResp.Reservations[0].Instances[0]

	// Wait for the task to start running. It will stay in the
	// PENDING state while the container is being pulled.
	if err := m.ecs.WaitUntilTasksNotPending(&ecs.DescribeTasksInput{
		Cluster: task.ClusterArn,
		Tasks:   []*string{task.TaskArn},
	}); err != nil {
		return fmt.Errorf("error waiting for %s to transition from PENDING state: %s", aws.StringValue(task.TaskArn), err)
	}

	// Open a new connection to the Docker daemon on the EC2
	// instance where the task is running.
	d, err := m.NewDockerClient(ec2Instance)
	if err != nil {
		return fmt.Errorf("error connecting to docker daemon on %s: %v", aws.StringValue(ec2Instance.InstanceId), err)
	}

	// Find the container id for the ECS task.
	containers, err := d.ListContainers(docker.ListContainersOptions{
		All: true,
		Filters: map[string][]string{
			"label": []string{
				fmt.Sprintf("com.amazonaws.ecs.task-arn=%s", aws.StringValue(task.TaskArn)),
				//fmt.Sprintf("com.amazonaws.ecs.container-name", p)
			},
		},
	})
	if err != nil {
		return fmt.Errorf("error listing containers for task: %v", err)
	}

	if len(containers) != 1 {
		return fmt.Errorf("unable to find container for %s running on %s", aws.StringValue(task.TaskArn), aws.StringValue(ec2Instance.InstanceId))
	}

	containerID := containers[0].ID

	if err := d.AttachToContainer(docker.AttachToContainerOptions{
		Container:    containerID,
		InputStream:  stdin,
		OutputStream: stdout,
		ErrorStream:  stderr,
		Logs:         true,
		Stream:       true,
		Stdin:        true,
		Stdout:       true,
		Stderr:       true,
		RawTerminal:  true,
	}); err != nil {
		return fmt.Errorf("error attaching to container (%s): %v", containerID, err)
	}

	return nil
}
1127775
func (r Ticket) GetTicketsClosedSinceDate(closeDate *datatypes.Time) (resp []datatypes.Ticket, err error) {
	params := []interface{}{
		closeDate,
	}
	err = r.Session.DoRequest("SoftLayer_Ticket", "getTicketsClosedSinceDate", params, &r.Options, &resp)
	return
}
294601
func (r Ticket) AddScheduledAlert(activationTime *string) (err error) {
	var resp datatypes.Void
	params := []interface{}{
		activationTime,
	}
	err = r.Session.DoRequest("SoftLayer_Ticket", "addScheduledAlert", params, &r.Options, &resp)
	return
}
1364133
func (r Ticket_Attachment_File) GetExtensionWhitelist() (resp []string, err error) {
	err = r.Session.DoRequest("SoftLayer_Ticket_Attachment_File", "getExtensionWhitelist", nil, &r.Options, &resp)
	return
}
757502
func (c *Context) FileAttachment(filepath, filename string) {
	c.Writer.Header().Set("content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename))
	http.ServeFile(c.Writer, c.Request, filepath)
}
537003
func NewAttachClient(conn io.ReadWriteCloser) AttachClient {
	return &attachClient{conn: conn, w: bufio.NewWriter(conn)}
}
543284
func (t *Trace) Attach(c context.Context) context.Context {
	return context.WithValue(c, traceKey, t)
}
243178
func (s *ISOService) AttachIso(p *AttachIsoParams) (*AttachIsoResponse, error) {
	resp, err := s.cs.newRequest("attachIso", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r AttachIsoResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}