}
@PUT
@Path("{key}")
public ServerMetadata setMetadataKey(@PathParam("key") String key, ServerMetadata metadata) throws CloudException {
InstanceData instance = getInstance();
if (metadata.metadata == null) {
metadata.metadata = metadata.meta;
}
if (metadata.metadata == null) {
throw new IllegalArgumentException();
}
Map<String, String> model = metadata.metadata;
for (Entry<String, String> entry : model.entrySet()) {
if (key.equals(entry.getKey())) {
instance = metadataServices.replaceMetadataKey(getProject(), instance.getId(), key, entry.getValue());
} else {
throw new IllegalArgumentException();
}
}