ImmutableSettings.settingsBuilder().put("index.blocks.read_only", true)));
ClusterUpdateSettingsResponse updateSettingsResponse = client().admin().cluster().prepareUpdateSettings().setTransientSettings(
ImmutableSettings.settingsBuilder().put("cluster.blocks.read_only", true).build()).get();
assertThat(updateSettingsResponse.isAcknowledged(), is(true));
ClusterStateResponse clusterStateResponseUnfiltered = client().admin().cluster().prepareState().setLocal(true).clear().setBlocks(true).get();
assertThat(clusterStateResponseUnfiltered.getState().blocks().global(), hasSize(1));
assertThat(clusterStateResponseUnfiltered.getState().blocks().indices().size(), is(1));
ClusterStateResponse clusterStateResponse = client().admin().cluster().prepareState().clear().get();
assertThat(clusterStateResponse.getState().blocks().global(), hasSize(0));
assertThat(clusterStateResponse.getState().blocks().indices().size(), is(0));
try {
client().admin().indices().prepareClose("foo-alias").get();
fail("close index should have failed");
} catch(ClusterBlockException e) {