// allArchitectures2 uses the MAAS2 controller to get architectures from boot
// resources.
540994
func (env *maasEnviron) allArchitectures2(ctx context.ProviderCallContext) ([]string, error) {
	resources, err := env.maasController.BootResources()
	if err != nil {
		common.HandleCredentialError(IsAuthorisationFailure, err, ctx)
		return nil, errors.Trace(err)
	}
	architectures := set.NewStrings()
	for _, resource := range resources {
		architectures.Add(strings.Split(resource.Architecture(), "/")[0])
	}
	return architectures.SortedValues(), nil
}
1269124
func (t *Template) GetAllAWSRDSDBClusterResources() map[string]*resources.AWSRDSDBCluster {
	results := map[string]*resources.AWSRDSDBCluster{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSRDSDBCluster:
			results[name] = resource
		}
	}
	return results
}
107084
func (t *Template) GetAllAWSEC2SubnetNetworkAclAssociationResources() map[string]*resources.AWSEC2SubnetNetworkAclAssociation {
	results := map[string]*resources.AWSEC2SubnetNetworkAclAssociation{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEC2SubnetNetworkAclAssociation:
			results[name] = resource
		}
	}
	return results
}
1338351
func (t *Template) GetAllAWSEC2VPNGatewayResources() map[string]*resources.AWSEC2VPNGateway {
	results := map[string]*resources.AWSEC2VPNGateway{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEC2VPNGateway:
			results[name] = resource
		}
	}
	return results
}
211903
func (t *Template) GetAllAWSApiGatewayV2IntegrationResources() map[string]*resources.AWSApiGatewayV2Integration {
	results := map[string]*resources.AWSApiGatewayV2Integration{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSApiGatewayV2Integration:
			results[name] = resource
		}
	}
	return results
}
1056036
func (t *Template) GetAllAWSOpsWorksInstanceResources() map[string]*resources.AWSOpsWorksInstance {
	results := map[string]*resources.AWSOpsWorksInstance{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSOpsWorksInstance:
			results[name] = resource
		}
	}
	return results
}
516769
func ParseArchitectureFlag(architectureArg string, config *rspec.LinuxSeccomp) error {
	correctedArch, err := parseArch(architectureArg)
	if err != nil {
		return err
	}

	shouldAppend := true
	for _, alreadySpecified := range config.Architectures {
		if correctedArch == alreadySpecified {
			shouldAppend = false
		}
	}
	if shouldAppend {
		config.Architectures = append(config.Architectures, correctedArch)
	}
	return nil
}
1090342
func (t *Template) GetAllAWSEC2TransitGatewayRouteTableResources() map[string]*resources.AWSEC2TransitGatewayRouteTable {
	results := map[string]*resources.AWSEC2TransitGatewayRouteTable{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEC2TransitGatewayRouteTable:
			results[name] = resource
		}
	}
	return results
}
584343
func (t *Template) GetAllAWSIAMAccessKeyResources() map[string]*resources.AWSIAMAccessKey {
	results := map[string]*resources.AWSIAMAccessKey{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSIAMAccessKey:
			results[name] = resource
		}
	}
	return results
}
1096010
func (t *Template) GetAllAWSEC2SubnetRouteTableAssociationResources() map[string]*resources.AWSEC2SubnetRouteTableAssociation {
	results := map[string]*resources.AWSEC2SubnetRouteTableAssociation{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEC2SubnetRouteTableAssociation:
			results[name] = resource
		}
	}
	return results
}
1337570
func (t *Template) GetAllAWSApiGatewayV2ModelResources() map[string]*resources.AWSApiGatewayV2Model {
	results := map[string]*resources.AWSApiGatewayV2Model{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSApiGatewayV2Model:
			results[name] = resource
		}
	}
	return results
}
302440
func (b *AutoscalingGroupModelBuilder) buildExternalLoadBalancerTasks(c *fi.ModelBuilderContext, ig *kops.InstanceGroup) error {
	for _, x := range ig.Spec.ExternalLoadBalancers {
		if x.LoadBalancerName != nil {
			c.AddTask(&awstasks.ExternalLoadBalancerAttachment{
				Name:             fi.String("extlb-" + *x.LoadBalancerName + "-" + ig.Name),
				Lifecycle:        b.Lifecycle,
				LoadBalancerName: *x.LoadBalancerName,
				AutoscalingGroup: b.LinkToAutoscalingGroup(ig),
			})
		}

		if x.TargetGroupARN != nil {
			c.AddTask(&awstasks.ExternalTargetGroupAttachment{
				Name:             fi.String("exttg-" + *x.TargetGroupARN + "-" + ig.Name),
				Lifecycle:        b.Lifecycle,
				TargetGroupARN:   *x.TargetGroupARN,
				AutoscalingGroup: b.LinkToAutoscalingGroup(ig),
			})
		}
	}

	return nil
}
1289841
func (t *Template) GetAllAWSEC2RouteResources() map[string]*resources.AWSEC2Route {
	results := map[string]*resources.AWSEC2Route{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEC2Route:
			results[name] = resource
		}
	}
	return results
}
1193067
func (t *Template) GetAllAWSOpsWorksLayerResources() map[string]*resources.AWSOpsWorksLayer {
	results := map[string]*resources.AWSOpsWorksLayer{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSOpsWorksLayer:
			results[name] = resource
		}
	}
	return results
}
1055112
func (t *Template) GetAllAWSIoTAnalyticsDatasetResources() map[string]*resources.AWSIoTAnalyticsDataset {
	results := map[string]*resources.AWSIoTAnalyticsDataset{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSIoTAnalyticsDataset:
			results[name] = resource
		}
	}
	return results
}
1051831
func (s *storage) SupportedArchitectures(criteria MetadataFilter) ([]string, error) {
	coll, closer := s.store.GetCollection(s.collection)
	defer closer()

	var arches []string
	if err := coll.Find(buildSearchClauses(criteria)).Distinct("arch", &arches); err != nil {
		return nil, errors.Trace(err)
	}
	return arches, nil
}
140166
func (t *Template) GetAllAWSEC2TransitGatewayRouteTableAssociationResources() map[string]*resources.AWSEC2TransitGatewayRouteTableAssociation {
	results := map[string]*resources.AWSEC2TransitGatewayRouteTableAssociation{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEC2TransitGatewayRouteTableAssociation:
			results[name] = resource
		}
	}
	return results
}