Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[azure][fix] Fix model and remove useless resources #1809

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/aws/resoto_plugin_aws/resource/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,12 +1807,12 @@ class AwsEc2VpcPeeringConnection(EC2Taggable, AwsResource, BasePeeringConnection
"connection_accepter_vpc_info": S("AccepterVpcInfo") >> Bend(AwsEc2VpcPeeringConnectionVpcInfo.mapping),
"connection_expiration_time": S("ExpirationTime"),
"connection_requester_vpc_info": S("RequesterVpcInfo") >> Bend(AwsEc2VpcPeeringConnectionVpcInfo.mapping),
"connection_status": S("Status") >> Bend(AwsEc2VpcPeeringConnectionStateReason.mapping),
"peering_connection_status": S("Status") >> Bend(AwsEc2VpcPeeringConnectionStateReason.mapping),
}
connection_accepter_vpc_info: Optional[AwsEc2VpcPeeringConnectionVpcInfo] = field(default=None)
connection_expiration_time: Optional[datetime] = field(default=None)
connection_requester_vpc_info: Optional[AwsEc2VpcPeeringConnectionVpcInfo] = field(default=None)
connection_status: Optional[AwsEc2VpcPeeringConnectionStateReason] = field(default=None)
peering_connection_status: Optional[AwsEc2VpcPeeringConnectionStateReason] = field(default=None)

def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None:
if self.connection_requester_vpc_info and (vpc_id := self.connection_requester_vpc_info.vpc_id):
Expand Down
2 changes: 1 addition & 1 deletion plugins/azure/resoto_plugin_azure/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def resource_with_params(clazz: Type[AzureResource], params: Set[str], includes_
return cp.issubset(params) and (not includes_all or params.issubset(cp))


all_resources: List[Type[AzureResource]] = compute_resources + base_resources
all_resources: List[Type[AzureResource]] = base_resources + compute_resources
global_resources = [r for r in all_resources if resource_with_params(r, {"subscriptionId"})]
regional_resources = [r for r in all_resources if resource_with_params(r, {"subscriptionId", "location"}, True)]

Expand Down
8 changes: 4 additions & 4 deletions plugins/azure/resoto_plugin_azure/resource/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ class AzureAvailabilitySet(AzureResource):
"platform_fault_domain_count": S("properties", "platformFaultDomainCount"),
"platform_update_domain_count": S("properties", "platformUpdateDomainCount"),
"proximity_placement_group": S("properties", "proximityPlacementGroup", "id"),
"sku": S("sku") >> Bend(AzureSku.mapping),
"azure_sku": S("sku") >> Bend(AzureSku.mapping),
"statuses": S("properties", "statuses") >> ForallBend(AzureInstanceViewStatus.mapping),
"virtual_machines_availability": S("properties") >> S("virtualMachines", default=[]) >> ForallBend(S("id")),
}
platform_fault_domain_count: Optional[int] = field(default=None, metadata={"description": "Fault domain count."})
platform_update_domain_count: Optional[int] = field(default=None, metadata={"description": "Update domain count."})
proximity_placement_group: Optional[str] = field(default=None, metadata={"description": ""})
sku: Optional[AzureSku] = field(default=None, metadata={'description': 'Describes a virtual machine scale set sku. Note: if the new vm sku is not supported on the hardware the scale set is currently on, you need to deallocate the vms in the scale set before you modify the sku name.'}) # fmt: skip
azure_sku: Optional[AzureSku] = field(default=None, metadata={'description': 'Describes a virtual machine scale set sku. Note: if the new vm sku is not supported on the hardware the scale set is currently on, you need to deallocate the vms in the scale set before you modify the sku name.'}) # fmt: skip
statuses: Optional[List[AzureInstanceViewStatus]] = field(default=None, metadata={'description': 'The resource status information.'}) # fmt: skip
virtual_machines_availability: Optional[List[str]] = field(default=None, metadata={'description': 'A list of references to all virtual machines in the availability set.'}) # fmt: skip

Expand Down Expand Up @@ -3098,7 +3098,7 @@ class AzureVirtualMachineScaleSet(AzureResource, BaseAutoScalingGroup):
"proximity_placement_group": S("properties", "proximityPlacementGroup", "id"),
"scale_in_policy": S("properties", "scaleInPolicy") >> Bend(AzureScaleInPolicy.mapping),
"single_placement_group": S("properties", "singlePlacementGroup"),
"scale_set_sku": S("sku") >> Bend(AzureSku.mapping),
"azure_sku": S("sku") >> Bend(AzureSku.mapping),
"spot_restore_policy": S("properties", "spotRestorePolicy") >> Bend(AzureSpotRestorePolicy.mapping),
"time_created": S("properties", "timeCreated"),
"unique_id": S("properties", "uniqueId"),
Expand All @@ -3123,7 +3123,7 @@ class AzureVirtualMachineScaleSet(AzureResource, BaseAutoScalingGroup):
proximity_placement_group: Optional[str] = field(default=None, metadata={"description": ""})
scale_in_policy: Optional[AzureScaleInPolicy] = field(default=None, metadata={'description': 'Describes a scale-in policy for a virtual machine scale set.'}) # fmt: skip
single_placement_group: Optional[bool] = field(default=None, metadata={'description': 'When true this limits the scale set to a single placement group, of max size 100 virtual machines. Note: if singleplacementgroup is true, it may be modified to false. However, if singleplacementgroup is false, it may not be modified to true.'}) # fmt: skip
scale_set_sku: Optional[AzureSku] = field(default=None, metadata={'description': 'Describes a virtual machine scale set sku. Note: if the new vm sku is not supported on the hardware the scale set is currently on, you need to deallocate the vms in the scale set before you modify the sku name.'}) # fmt: skip
azure_sku: Optional[AzureSku] = field(default=None, metadata={'description': 'Describes a virtual machine scale set sku. Note: if the new vm sku is not supported on the hardware the scale set is currently on, you need to deallocate the vms in the scale set before you modify the sku name.'}) # fmt: skip
spot_restore_policy: Optional[AzureSpotRestorePolicy] = field(default=None, metadata={'description': 'Specifies the spot-try-restore properties for the virtual machine scale set. With this property customer can enable or disable automatic restore of the evicted spot vmss vm instances opportunistically based on capacity availability and pricing constraint.'}) # fmt: skip
time_created: Optional[datetime] = field(default=None, metadata={'description': 'Specifies the time at which the virtual machine scale set resource was created. Minimum api-version: 2021-11-01.'}) # fmt: skip
unique_id: Optional[str] = field(default=None, metadata={'description': 'Specifies the id which uniquely identifies a virtual machine scale set.'}) # fmt: skip
Expand Down
Loading
Loading