I can create a new data store item for an sde file interactively via the wizard.
The wizard asks some other questions that I presume needs to be included in the ItemProperties in the add method, like a list of federated servers, and the "same as publisher" option.
The item this code creates has "unavailable" when I look at the federated servers list in the item's properties...
folder: Folder = [x for x in user.folders
if x.name == 'datastores'][0]
item_props = ItemProperties(
title="new_datastore_item",
item_type=ItemTypeEnum.DATA_STORE,
tags=["tag1"],
snippet="Demo datastore item item added from Python API"
# properties= "somehow a list of federated servers?"
)
add_job = folder.add(
item_properties=item_props,
file=r"C:\temp\test.sde"
)
print(type(add_job))
item = add_job.result()
print(item)
print(type(item.get_data()))
print(item.get_data())
#prints
# <class 'arcgis.gis._impl._content_manager.folder.core.Job'>
# <Item title:"new_datastore_item" type:Data Store owner:portaladmin>
# <class 'str'>
# C:\Users\KKUYKE~1\AppData\Local\Temp\test.sde
#status of all federated servers in item settings is "unavailable"