@@ -82,56 +82,6 @@ std::vector<std::string> Databases::list(std::string const& user) {
8282 }
8383}
8484
85- arangodb::Result Databases::info (TRI_vocbase_t* vocbase, VPackBuilder& result) {
86- if (ServerState::instance ()->isCoordinator ()) {
87- AgencyComm agency;
88- AgencyCommResult commRes = agency.getValues (" Plan/Databases/" + vocbase->name ());
89- if (!commRes.successful ()) {
90- // Error in communication, note that value not found is not an error
91- LOG_TOPIC (" 87642" , TRACE, Logger::COMMUNICATION)
92- << " rest database handler: no agency communication" ;
93- return Result (commRes.errorCode (), commRes.errorMessage ());
94- }
95-
96- VPackSlice value = commRes.slice ()[0 ].get <std::string>(
97- {AgencyCommManager::path (), " Plan" , " Databases" , vocbase->name ()});
98- if (value.isObject () && value.hasKey (" name" )) {
99-
100- VPackValueLength l = 0 ;
101- const char * name = value.get (" name" ).getString (l);
102- TRI_ASSERT (l > 0 );
103-
104- VPackObjectBuilder b (&result);
105- result.add (" name" , value.get (" name" ));
106- if (value.get (" id" ).isString ()) {
107- result.add (" id" , value.get (" id" ));
108- } else if (value.get (" id" ).isNumber ()) {
109- result.add (" id" , VPackValue (std::to_string (value.get (" id" ).getUInt ())));
110- } else {
111- THROW_ARANGO_EXCEPTION_MESSAGE (TRI_ERROR_INTERNAL,
112- " unexpected type for 'id' attribute" );
113- }
114- result.add (" path" , VPackValue (" none" ));
115- result.add (" isSystem" , VPackValue (name[0 ] == ' _' ));
116-
117- // copy from plan slice
118- auto one = arangodb::getOneShardOptions (name, value);
119- arangodb::addOneShardOptionsToOpenObject (result, one.first , one.second );
120-
121- }
122- } else {
123- VPackObjectBuilder b (&result);
124- result.add (" name" , VPackValue (vocbase->name ()));
125- result.add (" id" , VPackValue (std::to_string (vocbase->id ())));
126- result.add (" path" , VPackValue (vocbase->path ()));
127- result.add (" isSystem" , VPackValue (vocbase->isSystem ()));
128- arangodb::addOneShardOptionsToOpenObject (result, vocbase->sharding (), vocbase->replicationFactor ());
129-
130- result.close ();
131- }
132- return Result ();
133- }
134-
13585arangodb::Result Databases::create (std::string const & dbName, VPackSlice const & inUsers,
13686 VPackSlice const & inOptions) {
13787 auth::UserManager* um = AuthenticationFeature::instance ()->userManager ();
0 commit comments